.while True:. try:. line = input(). except EOFError:. break. a=[int(i) for i in line.split(" ")]. while 0 not in a:. a[0],a[1]=min(a),max(a)-max(a)//min(a)*min(a). print(max(a))