import sys input = sys.stdin.readline A, B = map(int, input().split()) while A>0 or B>0: a = A%10 b = B%10 if a