a,b = map(int,input().split()) while a or b: if a%10