program tac; type Line = record data : string; next : ^Line end; PLine = ^Line; function read(): PLine; begin new(read); readln(read^.data); end; var next, this : PLine; begin this := nil; while not eof(input) do begin next := read(); next^.next := this; this := next; end; while not (this = nil) do begin writeln(this^.data); next := this^.next; dispose(this); this := next; end; end.