- sol: 백트래킹
- next_permuation을 통한 간단한 풀이 가능
- permutation 계열 함수의 리턴 값은 다음 순열이 있는가?
#include <bits/stdc++.h>
using namespace std;
string X;
int main(){
cin >> X;
string tmp = X;
if(next_permutation(X.begin(), X.end())) cout << X;
else cout << 0;
return 0;
}