s=float(input('前项:'))
d=float(input('后项:'))
a=1
f=[]
while a<=s and a<=d:
if s%a==0 and d%a==0:
f.append(a)
a=a+1
else:
a=a+1
g=max(f)
print(f'{s//g}比{d//g}')
s=float(input('前项:'))
d=float(input('后项:'))
a=1
f=[]
while a<=s and a<=d:
if s%a==0 and d%a==0:
f.append(a)
a=a+1
else:
a=a+1
g=max(f)
print(f'{s//g}比{d//g}')