a,b=map(int,input().split()) while b: print(a//b,end=" ") a,b=b,a%b