#include <iostream>
using namespace std;
int main() {
unsigned int n, a, acopy, max_number = 0, value = 1000000000, local_number;
cin >> n;
while (n--) {
cin >> a;
acopy = a;
for (local_number = 0; acopy % 10 == 0; local_number++) acopy /= 10;
if ( local_number > max_number) {
max_number = local_number;
value = a;
}
else if (local_number == max_number && a < value) value = a;
}
cout << value;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCgppbnQgbWFpbigpIHsKICAgIHVuc2lnbmVkIGludCBuLCBhLCBhY29weSwgbWF4X251bWJlciA9IDAsIHZhbHVlID0gMTAwMDAwMDAwMCwgbG9jYWxfbnVtYmVyOwogICAgY2luID4+IG47CiAgICB3aGlsZSAobi0tKSB7CiAgICAJY2luID4+IGE7CiAgICAgICAgYWNvcHkgPSBhOwogICAgICAgIGZvciAobG9jYWxfbnVtYmVyID0gMDsgYWNvcHkgJSAxMCA9PSAwOyBsb2NhbF9udW1iZXIrKykgYWNvcHkgLz0gMTA7CiAgICAgICAgaWYgKCBsb2NhbF9udW1iZXIgPiBtYXhfbnVtYmVyKSB7CiAgICAgICAgCW1heF9udW1iZXIgPSBsb2NhbF9udW1iZXI7CiAgICAgICAgCXZhbHVlID0gYTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAobG9jYWxfbnVtYmVyID09IG1heF9udW1iZXIgJiYgYSA8IHZhbHVlKSB2YWx1ZSA9IGE7CiAgICB9CiAgICBjb3V0IDw8IHZhbHVlOwogICAgcmV0dXJuIDA7Cn0K