#include <iostream> #include <algorithm> #include <string.h> using namespace std; bool cmp(int a, int b) { return a > b; } int s1[10000]; int main() { cin >> s1; sort(s1.begin(), s1.end(), cmp); do { cout << s1 << " "; } while (next_permutation(s1.begin(), s1.end(),cmp)); }