#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
string s;
cout << ">";
cin >> s;
vector<char> data(s.begin(), s.end());
do {
for (unsigned int i = 0; i < data.size(); i++) {
cout << data[i];
}
cout << endl;
} while (next_permutation(data.begin(), data.end()));
return 0;
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkKewoJc3RyaW5nIHM7CgoJY291dCA8PCAiPiI7CgljaW4gPj4gczsKCXZlY3RvcjxjaGFyPiBkYXRhKHMuYmVnaW4oKSwgcy5lbmQoKSk7CglkbyB7CgkJZm9yICh1bnNpZ25lZCBpbnQgaSA9IDA7IGkgPCBkYXRhLnNpemUoKTsgaSsrKSB7CgkJCWNvdXQgPDwgZGF0YVtpXTsKCQl9CgkJY291dCA8PCBlbmRsOwoJfSB3aGlsZSAobmV4dF9wZXJtdXRhdGlvbihkYXRhLmJlZ2luKCksIGRhdGEuZW5kKCkpKTsKCXJldHVybiAwOwp9Cg==