1969 最大公约数2


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

最大公约数的计算方法很多,但本题不希望看到用笨办法能AC的事情发生。现求四个数的最大公约数,看你能不能过呢?

Input

多组数据,每组数据含四个正整数a,b,c,d(a,b,c,d均小于2^31)。

Output

对于每组数据,输出其最大公约数,占一行。

Sample

Input

2 4 6 8
5 15 25 85
7 21 24 64

Output

2
5
1

Source: qn


Comments

There are no comments at the moment.