j;main(k){for(printf("Gray code n=%d",k=atoi(gets())),k++;j>k-j%k-1&3]:10);}