#include "bits/stdc++.h" #define debug(x) cout<<#x<<": "< VI; typedef vector> VVI; typedef long long ll; void solve() { #ifdef _WIN32 istream &cin = ifstream("input.txt"); #endif string x; cin >> x; char c = '0'; int j = 0; rep(i, x.size()) { if (c <= x[i]) { c = x[i]; j = i; } } int k = 0; while (x[k] == x[j]) k++; if (k != x.size()) { char tmp = x[j]; x[j] = x[k]; x[k] = tmp; } cout << x << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); solve(); system("PAUSE"); return 0; }