import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
class Main
{
{
int n, e, k=0, m, maxk = 0, maxn = 1000000000, p = 1;
Scanner in
= new Scanner
(System.
in); e = in.nextInt();
while (e -- > 0) {
n = in.nextInt();
if (p <= n){
m = n;
k = 0;
while ((n % 10) == 0) {
//считает нули
n = n / 10;
k ++;
}
if (maxk < k) {
maxn = m;
maxk = k;
p = 1;
for (int i = 1; i < maxk; i ++) {
p *= 10;
}
} else if (maxk == k) {
if(maxn > m) maxn = m;
}
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKCmNsYXNzIE1haW4KewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJaW50IG4sIGUsIGs9MCwgbSwgbWF4ayA9IDAsIG1heG4gPSAxMDAwMDAwMDAwLCBwID0gMTsKCQlTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQllID0gaW4ubmV4dEludCgpOwoJCXdoaWxlIChlIC0tID4gMCkgewogICAgICAgIAluID0gaW4ubmV4dEludCgpOwoJCQlpZiAocCA8PSBuKXsKCQkJCW0gPSBuOwoJCQkJayA9IDA7CgkJCQl3aGlsZSAoKG4gJSAxMCkgPT0gMCkgewoJCQkJCS8v0YHRh9C40YLQsNC10YIg0L3Rg9C70LgKCQkJCQluID0gbiAvIDEwOwoJCQkJCWsgKys7CgkJCQl9CgkJCQlpZiAobWF4ayA8IGspIHsKCQkJCQltYXhuID0gbTsKCQkJCQltYXhrID0gazsKCQkJCQlwID0gMTsKCQkJCQlmb3IgKGludCBpID0gMTsgaSA8IG1heGs7IGkgKyspIHsKCQkJCQkJcCAqPSAxMDsKCQkJCQl9CgkJCQl9IGVsc2UgaWYgKG1heGsgPT0gaykgewoJCQkJCWlmKG1heG4gPiBtKSBtYXhuID0gbTsKCQkJCX0KCQkJfQoJCX0KCQlTeXN0ZW0ub3V0LnByaW50KG1heG4pOwoJfQp9