[50{(%stdin)(r)file 30 string readline pop dup()eq{pop}if}repeat]1 1 10000 -1 1{3 index{dup(7941)search{pop exch}{( )search def}ifelse pop cvi 2 index eq{3 index =only( )print = exch 1 add exch[}if pop}forall pop exch pop dup}for