char*p;main(a,b){for(;gets(b);puts(b))for(p=index(b,0);(*--p^=1)%7;);}