h(n,s,d){n?h(n-1,s,6-s-d)+h(0,s,d)+h(n-1,6-d-s,d):printf("%d%d\n",s,d);}main(n){h(n-1,1,3);}

