#include <stdio.h>
#define P1 1
#define P2 2
#define P3 3
void hannuota(int n,int a,int b,int c){
if(n>=1){
hannuota(n-1,a,c,b);
printf("%d(%d->%d)\n",n,a,c);
hannuota(n-1,b,a,c);
}else{
return;
}
}
int main(){
int n;
scanf("%d",&n);
hannuota(n,P1,P2,P3);
return 0;
}
// (n)[1->3]
// (n-1)[1->2] ,n[1-3], (n-1)[2->3]
//(n-3)[1->3],n-1[1->2],(n-2)[3->2] (n-3)[2-1],n-2[2->3],(n-3)[2->3]
#define P1 1
#define P2 2
#define P3 3
void hannuota(int n,int a,int b,int c){
if(n>=1){
hannuota(n-1,a,c,b);
printf("%d(%d->%d)\n",n,a,c);
hannuota(n-1,b,a,c);
}else{
return;
}
}
int main(){
int n;
scanf("%d",&n);
hannuota(n,P1,P2,P3);
return 0;
}
// (n)[1->3]
// (n-1)[1->2] ,n[1-3], (n-1)[2->3]
//(n-3)[1->3],n-1[1->2],(n-2)[3->2] (n-3)[2-1],n-2[2->3],(n-3)[2->3]