int input 1001 for in range map int input split while max for in range

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n = int(input())
a = [0]*1001
for i in range(n):
x,y = map(int,input().split())
while y > 0:
y,x = x%y,y
a[x] += 1
t = max(a)
a = [i for i in range(1,1001) if t == a[i]][::-1]
print(*a)