#include <iostream>
using namespace std;
int sol[11];
void afisare(int lvl){
//Afiseaza solutia
int i=1;
cout << "\n";
for(i=1;i<=lvl;i++){
cout << sol[i];
}
}
void bkt(int lvl){
//Subprogram principal backtracking
sol[lvl] = sol[lvl-1]+2;
cout << sol[lvl];
while(sol[lvl]<9){
afisare(lvl);
bkt(lvl+1);
sol[lvl]+=2;
}
}
int main(){
sol[0]=-1;
bkt(1);
}
1
13
135
1357
13579
1379
157
1579
179
35
357
3579
379
57
579
79