1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cstring> 5 6 using namespace std; 7 const int maxn = 1e5 + 100; 8 char str[maxn]; 9 int a[maxn]; 10 11 int main() 12 { 13 int n, i, j, ans, t, tt, ttt, mod; 14 scanf("%s", str); 15 n = strlen(str); 16 ans = 2; 17 j = 0; 18 for (i = n - 1; i >= 0; i--) { 19 if (str[i] >= '0'&&str[i] <= '9') { 20 a[j] = str[i] - '0'; 21 ans = max(ans, a[j] + 1); 22 } 23 else { 24 a[j] = str[i] - 'A' + 10; 25 ans = max(ans, a[j] + 1); 26 } 27 j++; 28 } 29 a[j] = '