#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n=next_permutation(123);
    cout<<n;
}