for(n=0;s=readline().split(/ +/);)1-s||putstr(s[n++%s.length]+" ")