#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int used_index[13]; int max_i; int max_j; int max_k; long long tmp_max = 0; long long ans=0; int main() { string s; cin >> s; bool judge = true; while (judge) { /* memset(used_index,0,sizeof(used_index));*/ judge = false; tmp_max =0; for (int i = 0; i < s.length() - 2; i++) { for (int j = i + 1; j < s.length() - 1; j++) { for (int k = j + 1; k < s.length(); k++) { if (s[j] == s[k] && s[i] != s[j]) { if (used_index[i] == 0 && used_index[j] == 0 && used_index[k] == 0) { if (tmp_max < (s[i] - '0') * 100 + (s[j] - '0') * 10 + s[j] - '0') { tmp_max = (s[i] - '0') * 100 + (s[j] - '0') * 10+ s[j] - '0'; max_i = i; max_j =j; max_k =k; /* cout<