#include<iostream>
using namespace std;
void Permutation(char* s,char* p) {
if (*p=='\0') cout << s << endl;
for (char* begin = p; *begin != '\0'; begin++){
swap(*begin,*p);
Permutation(s,p+1);
swap(*begin, *p);
}
}
int main(){
char c[] = {'a','b','c','\0'};
char* s = c;
char* p = s;
Permutation(s,p);
return 0;
}