# 6059-6062 기초-비트단위논리연산

# 6059
n = int(input())
print(~n)

# 6060
a, b = map(int, input().split())
print(a & b)

# 6061
a, b = map(int, input().split())
print(a | b)

# 6062
a, b = map(int, input().split())
print(a ^ b)

a8c8fb2fff6410356fa571d6f68eb840b4d05afb
<mask token>

<mask token>
print(~n)
<mask token>
print(a & b)
<mask token>
print(a | b)
<mask token>
print(a ^ b)

n = int(input())
print(~n)
a, b = map(int, input().split())
print(a & b)
a, b = map(int, input().split())
print(a | b)
a, b = map(int, input().split())
print(a ^ b)

# 6059-6062 기초-비트단위논리연산

# 6059
n = int(input())
print(~n)

# 6060
a, b = map(int, input().split())
print(a & b)

# 6061
a, b = map(int, input().split())
print(a | b)

# 6062
a, b = map(int, input().split())
print(a ^ b)
