l#include <stdio.h>
#include
#include
#include
#include
using namespace std;
int main()
{
string s;
cin>>s;
sort(s.begin(),s.end());//排序让字符串字典序 下面函数一般是字典序全排列
do{
cout<<s<<endl;
}
while(next_permutation(s.begin(),s.end()));//输出下一个排列的函数(有标记功能)
return 0;
}