#include using namespace std; int main() { string N; cin >> N; int Max_number = 0; int N_N = N.size(); for (int i = 0; i < N_N; i++) { Max_number = max(Max_number, N[i] - '0'); } for (int i = N_N - 1; i >= 0; i--) { if (N[i]-'0' == Max_number) { swap(N[0], N[i]); cout << N; return 0; } } }