import java.io.*;
import java.util.Scanner;
class GCD {
public static int gcd(int a,int b) {
while (b !=0) {
int tmp = a%b;
a = b;
b = tmp;
}
return a;
}
}
class Main {
Scanner in
= new Scanner
(System.
in); int t = in.nextInt();
int b = in.nextInt();
for (int i=2; i<=t; ++i) {
int a = in.nextInt();
b = GCD.gcd (a, b);
}
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKY2xhc3MgR0NEIHsKCXB1YmxpYyBzdGF0aWMgaW50IGdjZChpbnQgYSxpbnQgYikgewoJCXdoaWxlIChiICE9MCkgewoJCQlpbnQgdG1wID0gYSViOwoJCQlhID0gYjsKCQkJYiA9IHRtcDsKCQl9CgkJcmV0dXJuIGE7Cgl9Cn0KCmNsYXNzIE1haW4gewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uIHsKCQlTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlpbnQgdCA9IGluLm5leHRJbnQoKTsKCQlpbnQgYiA9IGluLm5leHRJbnQoKTsKCQlmb3IgKGludCBpPTI7IGk8PXQ7ICsraSkgewoJCQlpbnQgYSA9IGluLm5leHRJbnQoKTsKCQkJYiA9IEdDRC5nY2QgKGEsIGIpOwoJCX0KCQlTeXN0ZW0ub3V0LnByaW50KGIpOwoJfQp9