import sys



def solve():

    A = int(eval(input()))

    B = int(eval(input()))

    Num = set([A, B])

    All = set([1, 2, 3])

    All -= Num

    for key in All: print(key)



    return 0



if __name__ == "__main__":

    solve()
import sys



def solve():

    input = sys.stdin.readline

    A = int(eval(input()))

    B = int(eval(input()))

    C = list(set([1, 2, 3]) - set([A, B]))

    print((C[0]))



    return 0



if __name__ == "__main__":

    solve()
import sys


def solve():
    A = int(eval(input()))
    B = int(eval(input()))
    Num = set([A, B])
    All = set([1, 2, 3])
    All -= Num
    for key in All:
        print(key)
    return 0


if __name__ == "__main__":
    solve()

import sys


def solve():
    input = sys.stdin.readline
    A = int(eval(input()))
    B = int(eval(input()))
    C = list(set([1, 2, 3]) - set([A, B]))
    print((C[0]))
    return 0


if __name__ == "__main__":
    solve()

+    input = sys.stdin.readline -    Num = set([A, B]) -    All = set([1, 2, 3]) -    All -= Num -    for key in All: -        print(key) +    C = list(set([1, 2, 3]) - set([A, B])) +    print((C[0]))