f=map(int,raw_input().split()) n=input() exec"print n;i=1\nwhile n%f[i]:i+=2\nn=n*f[i-1]/f[i];"*201