AtCoder Beginner Contest 148 - Round One

Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B are both wrong.
Print the correct choice for this problem.

-----Constraints-----
 - Each of the numbers A and B is 1, 2, or 3.
 - A and B are different.

-----Input-----
Input is given from Standard Input in the following format:
A
B

-----Output-----
Print the correct choice.

-----Sample Input-----
3
1

-----Sample Output-----
2

When we know 3 and 1 are both wrong, the correct choice is 2.

Source: atcoder | Difficulty: EASY


Solutions:
a = int(input())
b = int(input())
ans_list = [1, 2, 3]
ans_list.remove(a)
ans_list.remove(b)
print(ans_list[0])


a = int(input())
b = int(input())
for i in range(1, 4):
	if i not in [a, b]:
		print(i)


A = int(input())
B = int(input())
C = 6
ans = C - (A + B)
print(ans)


a = int(input())
b = int(input())
c = 6 - (a + b)
print(int(c))


a = int(input())
b = int(input())
s = a + b
print(6 - s)


A = eval(input())
B = eval(input())
print(6 - A - B)


L = [1, 2, 3]
a = int(input())
b = int(input())
L.remove(a)
L.remove(b)
print(L[0])


a = input()
a1 = int(a)
b = input()
b1 = int(b)
print(6 - a1 - b1)


print('123'.replace(input(), '').replace(input(), ''))


n = [1, 2, 3]
a = input()
b = input()
n.remove(int(a))
n.remove(int(b))
print(n[0])


A = int(input())
B = int(input())
print(6 - A - B)


a = int(input())
b = int(input())
print(*{1, 2, 3} - {a, b})


a = int(input())
b = int(input())
ans_set = [1, 2, 3]
ans_set.remove(a)
ans_set.remove(b)
print(ans_set[0])


Ans = ['1', '2', '3']
for i in range(2):
	a = input()
	Ans.remove(a)
print(Ans[0])


ans = [1, 2, 3]
ans.remove(int(input()))
ans.remove(int(input()))
print(ans[0])


a = int(input())
b = int(input())
l = [1, 2, 3]
if a > b:
	l.pop(a - 1)
	l.pop(b - 1)
else:
	l.pop(b - 1)
	l.pop(a - 1)
print(l[0])


A = int(input())
B = int(input())
print(1 + 2 + 3 - A - B)


x = int(input())
y = int(input())
if x == 1 and y == 2 or (x == 2 and y == 1):
	print(3)
if x == 1 and y == 3 or (x == 3 and y == 1):
	print(2)
if x == 3 and y == 2 or (x == 2 and y == 3):
	print(1)


(a, b) = map(int, open(0))
print(a ^ b)


x = 6
x = x - int(input())
x = x - int(input())
print(x)


a = int(input())
b = int(input())
print(*set(range(1, 4)) - {a, b})


n = int(input())
m = int(input())
print(6 - m - n)


ans = {'1', '2', '3'} - {input(), input()}
print(ans.pop())


A = int(input())
B = int(input())
MON = 6
ANS = 6 - A - B
print(ANS)


A = int(input())
print(6 - A - int(input()))


(A, B) = [int(input()) for _ in range(2)]
print(6 - A - B)


(A, B) = map(int, open(0).read().split())
print(6 - A - B)


ans = 6
print(ans - int(input()) - int(input()))


a = input()
b = input()
print('123'.replace(a, '').replace(b, ''))


n = int(input())
b = int(input())
print(6 - n - b)


print(6 // (int(input()) * int(input())))


s = [1, 2, 3]
for _ in range(2):
	s.remove(int(input()))
print(s[0])


a = int(input())
b = int(input())
if a + b == 3:
	print(3)
elif a + b == 4:
	print(2)
else:
	print(1)


ans = 6
for _ in range(2):
	ans -= int(input())
print(ans)


x1 = int(input())
x2 = int(input())
a = 6 - x1 - x2
print(a)


ab = [int(input()) for i in range(2)]
print(*{1, 2, 3} - set(ab))


ls = [1, 2, 3]
ls.remove(int(input()))
ls.remove(int(input()))
print(ls[0])


num = [1, 2, 3]
num.remove(int(input()))
num.remove(int(input()))
print(num.pop())
return


a = int(input())
b = int(input())
total = a + b
print(6 - total)


A = int(input())
B = int(input())
lis = [1, 2, 3]
x = lis.index(A)
y = lis.index(B)
lis[x] = 0
lis[y] = 0
ans = sum(lis)
print(ans)


a = int(input())
b = int(input())
if a * b == 6:
	print(1)
elif a * b == 3:
	print(2)
else:
	print(3)


S = input()
S += input()
print(*[a for a in '123' if a not in S])


A = int(input())
B = int(input())
ans = [1, 2, 3]
ans.remove(A)
ans.remove(B)
print(ans[0])


n = int(input())
l = int(input())
print(6 - n - l)


print(6 - sum([int(input()) for i in range(2)]))


a = int(input())
b = int(input())
s = set([1, 2, 3])
s.remove(a)
s.remove(b)
print(*s)


l = [1, 2, 3]
l.remove(int(input()))
l.remove(int(input()))
print(l[0])


A = {int(input()) for _ in range(2)}
print(*{1, 2, 3} - A)


a = int(input())
b = int(input())
if a == 1 and b == 2 or (a == 2 and b == 1):
	print(3)
elif a == 2 and b == 3 or (a == 3 and b == 2):
	print(1)
elif a == 1 and b == 3 or (a == 3 and b == 1):
	print(2)


a = 6 - int(input())
a = a - int(input())
print(a)


A = int(input())
B = int(input())
print(str(6 - sum([A, B])))


a = int(input())
b = int(input())
goukei = a + b
print(6 - a - b)


u = {1, 2, 3}
d = {int(input()) for i in range(2)}
print(list(u - d)[0])


print(*{1, 2, 3} - set(map(int, open(0))))


(a, b) = [int(input()) for i in range(2)]
print(6 // (a * b))


D = 6
A = int(input(''))
B = int(input(''))
C = D - A - B
print(C)


a = input()
b = input()
ans = 6 - int(a) - int(b)
print(ans)


A = int(input())
B = int(input())
L = A + B
print(5 - L + 1)


ans = 0
ans += int(input())
ans += int(input())
print(6 - ans)


print(6 - sum(map(int, open(0).read().split())))


A = int(input())
B = int(input())
for i in range(1, 4):
	if i not in [A, B]:
		print(i)


A = input()
B = input()
a = int(A)
b = int(B)
C = 6 - a - b
print(C)


(a, b) = map(int, [input() for _ in range(2)])
print(6 - a - b)


a = int(input())
b = int(input())
kotae = 6 - a - b
print(kotae)


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float('inf')
(YES, Yes, yes, NO, No, no) = ('YES', 'Yes', 'yes', 'NO', 'No', 'no')
(dy4, dx4) = ([0, 1, 0, -1], [1, 0, -1, 0])
(dy8, dx8) = ([0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1])

def inside(y, x, H, W):
	return 0 <= y < H and 0 <= x < W

def ceil(a, b):
	return (a + b - 1) // b

def sum_of_arithmetic_progression(s, d, n):
	return n * (2 * s + (n - 1) * d) // 2

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	g = gcd(a, b)
	return a / g * b

def solve():
	A = int(input())
	B = int(input())
	for i in range(1, 4):
		if i != A and i != B:
			print(i)
			break

def main():
	solve()

def __starting_point():
	main()
__starting_point()


a = int(input())
b = int(input())
sum = 6
print(sum - a - b)


a = input().strip()
b = input().strip()
print(6 - int(a) - int(b))


print(6 - sum((int(input()) for _ in range(2))))


ans = '123'
print(ans.replace(input(), '').replace(input(), ''))


x = '123'
for _ in range(2):
	x = x.replace(input(), '')
print(x)


a = int(input())
print(list({1, 2, 3} - {a} - {int(input())})[0])


x = input()
y = input()
x = int(x)
y = int(y)
print(6 - (x + y))


(A, B) = [int(_) for _ in open(0).read().split()]
print(6 - A - B)


a = int(input())
b = int(input())
print(a ^ b)


in1 = int(input())
in1 += int(input())
print(6 - in1)


N = int(input())
M = int(input())
print(6 - N - M)


num1 = int(input())
num2 = int(input())
print(6 - num1 - num2)


a = [int(input()) for i in range(2)]
print(6 - a[0] - a[1])


A = int(input())
B = int(input())
if A == 1 and B == 2 or (A == 2 and B == 1):
	print(3)
elif A == 3 and B == 2 or (A == 2 and B == 3):
	print(1)
elif A == 1 and B == 3 or (A == 3 and B == 1):
	print(2)


ab = [int(input()) for x in range(2)]
print(6 - sum(ab))


print(int(input()) ^ int(input()))


a = ['1', '2', '3']
a.remove(input())
a.remove(input())
print(a[0])


(A, B) = (int(input()), int(input()))
print(list({1, 2, 3} - {A, B})[0])


i = int(input())
j = int(input())
print(6 - (i + j))


A = int(input())
B = int(input())
l = [1, 2, 3]
l.remove(A)
l.remove(B)
print(l[0])


n = {1, 2, 3} - {int(input()) for _ in range(2)}
print(n.pop())


(A, B) = open(0)
print(6 - int(A) - int(B))


n = int(input())
m = int(input())
print((5 - n - m) % 3 + 1)


print(*set('123') - {input(), input()})


A = int(input())
B = int(input())
List = [A, B]
print(6 - sum(List))


i = int(input())
j = int(input())
a = 6 - (i + j)
print(str(a))


a = int(input())
b = int(input())
print('1' if a + b == 5 else '2' if a + b == 4 else '3')


a1 = int(input())
a2 = int(input())
print(6 - a1 - a2)


a = int(input())
b = int(input())
if a == 1:
	if b == 2:
		print('3')
	elif b == 3:
		print('2')
elif a == 2:
	if b == 1:
		print('3')
	elif b == 3:
		print('1')
elif a == 3:
	if b == 1:
		print('2')
	elif b == 2:
		print('1')


a = [int(input()) for i in range(2)]
b = [1, 2, 3]
b.remove(a[0])
b.remove(a[1])
print(b[0])


A = input()
B = input()
candidate = set(('1', '2', '3'))
exclude = set((A, B))
print((candidate - exclude).pop())


A = int(input())
B = int(input())
ans = {1, 2, 3} - {A, B}
print(ans.pop())


a = int(input())
b = int(input())
if a + b == 3:
	print(3)
elif a + b == 5:
	print(1)
else:
	print(2)


ans = 6
for i in [0] * 2:
	ans -= int(input())
print(ans)


print(1 ^ 2 ^ 3 ^ int(input()) ^ int(input()))


A = int(input())
B = int(input())
ab = {A, B}
All = {1, 2, 3}
Ans = list(All - ab)
print(Ans[0])


S = set((int(input()) for i in range(2)))
print(list({1, 2, 3} - S)[0])


(A, B) = [int(input()) for i in range(2)]
print(6 // A // B)


print(min(3, 7 - (1 << int(input()) - 1) - (1 << int(input()) - 1)))


e = input
print(int(e()) ^ int(e()))


s = {int(input()) for s in range(2)}
a = {1, 2, 3}
print(list(a - s)[0])


n = int(input())
a = int(input())
print(6 - n - a)


print(1 + 2 + 3 - sum(map(int, [input(), input()])))


a = 0
a += int(input())
a += int(input())
print(6 - a)


print('123'.translate(str.maketrans({input(): '', input(): ''})))


a = int(input())
b = int(input())
print(3 - (a + b) % 3)


s = input()
t = input()
print(6 - int(s) - int(t))


a = int(input())
b = int(input())
ans = [1, 2, 3]
ans.remove(a)
ans.remove(b)
print(ans[0])


I = map(int, open(0))
print(6 - sum(I))


sum = 0
sum += int(input())
sum += int(input())
print(6 - sum)


import sys
a = int(input())
b = int(input())
print(6 - a - b)


(A, B) = [int(input()) for _ in range(2)]
print(list(set([1, 2, 3]) - set([A, B]))[0])


x = [int(input()) for i in range(2)]
print(6 - x[0] - x[1])


a = {int(input()), int(input())}
s = {1, 2, 3}
print((s - a).pop())


a = int(input())
b = int(input())
print('{}'.format(6 - a - b))


A = int(input())
B = int(input())
print(A ^ B)


a = int(input())
b = int(input())
if a + b == 3:
	print(3)
elif a + b == 4:
	print(2)
elif a + b == 5:
	print(1)


a = int(input())
b = int(input())
ans = {1, 2, 3} - {a, b}
print(ans.pop())


ans = list(range(1, 4))
for i in range(2):
	ans.remove(int(input()))
print(ans[0])


(A, B) = (input(), input())
print('123'.replace(A, '').replace(B, ''))


import sys
from itertools import chain

def solve(A: int, B: int):
	answer = 6 - A - B
	return answer

def main():
	tokens = chain(*(line.split() for line in sys.stdin))
	A = int(next(tokens))
	B = int(next(tokens))
	answer = solve(A, B)
	print(answer)

def __starting_point():
	main()
__starting_point()


X = {1, 2, 3}
a = {int(input())}
b = {int(input())}
print(list(X - a - b)[0])


L = [1, 2, 3]
d = int(input())
L.remove(d)
d = int(input())
L.remove(d)
print(L[0])


n = int(input())
k = int(input())
print(6 - (n + k))


(a, b) = map(int, open(0).read().split())
print(6 - a - b)


ans = {'1', '2', '3'}
(a, b) = (input(), input())
print(*ans - set([a, b]))


print(6 - eval(input() + '+' + input()))


n = int(input())
t = int(input())
print(6 - n - t)


ab = int(input()) + int(input())
print(6 - ab)


g = int(input())
k = int(input())
c = g + k
print(6 - c)


num_l = [1, 2, 3]
num_l.remove(int(input()))
num_l.remove(int(input()))
print(num_l.pop())


S1 = int(input())
S2 = int(input())
print(6 - S1 - S2)


n = 6
n -= int(input())
n -= int(input())
print(n)


l = [int(input()) for _ in range(2)]
print(l[0] ^ l[1])