#include #include int main() { int n; scanf("%d", &n); unsigned long long res=1ULL<<63; while (n--) { char s[32]; scanf("%s", s); char* p=&s[31]; for(int b=2;b<=36;++b) { if (b==16 and s[0]=='0' and s[1]=='X') continue; auto t=strtoll(s, &p, b); if (*p==0 and res>t) res=t; } } printf("%llu\n", res); }