char*p;main(s){for(;p=index(&s,!gets(&s));puts())for(;(*--p^=1)%7;);}