N,M = map(int,input().split()) while M: q = N // M r = N % M print(q,end = " ") N = M M = r print()