fork download
  1. i,n=input(),'\n';exec"print n.join(i)+n;i=map(i.pop,[-1,0]*3);"*6
Success #stdin #stdout 0s 9032KB
stdin
['house', 'grandmother', 'child', 'stove', 'almanac', 'tears']
stdout
house
grandmother
child
stove
almanac
tears

tears
house
almanac
grandmother
stove
child

child
tears
stove
house
grandmother
almanac

almanac
child
grandmother
tears
house
stove

stove
almanac
house
child
tears
grandmother

grandmother
stove
tears
almanac
child
house