a = int(input('Enter A: '))
b = int(input('Enter B: '))
arr = []
for i in range(1, 1001):
if a % i == 0 and b % i == 0:
arr.append(i)
print('Values: ', *arr)
a = int(input('Enter A: '))
b = int(input('Enter B: '))
arr = []
for i in range(1, 1001):
if a % i == 0 and b % i == 0:
arr.append(i)
print('Values: ', *arr)