class CatLoop(Input,Print) extends Chain {
Print p;
Input i;
method continue(Passive accumulator) {
p = new Print(Passive,Chain);
p.next = next;
i = new Input(Passive,Chain);
i.next = p;
goto i.continue(new 0(Passive));
}
}
class Cat(CatLoop,Input,Print,Chain) extends Program {
CatLoop a;
method continue(Passive accumulator) {
a = new CatLoop(Passive,Chain,Input,Print);
a.next = a;
goto a.continue(new 0(Passive));
}
}