def c(first, *other):
d = set([n for n in range(1, first+1) if first%n==0])
for x in other:
k = set([n for n in range(1, x+1) if x%n==0])
z = k&d
return max(z)
ZGVmIGMoZmlyc3QsICpvdGhlcik6CiAgICBkID0gc2V0KFtuIGZvciBuIGluIHJhbmdlKDEsIGZpcnN0KzEpIGlmIGZpcnN0JW49PTBdKQogICAgZm9yIHggaW4gb3RoZXI6CiAgICAgICAgayA9IHNldChbbiBmb3IgbiBpbiByYW5nZSgxLCB4KzEpIGlmIHglbj09MF0pCiAgICAgICAgeiA9IGsmZAogICAgcmV0dXJuIG1heCh6KQ==