% printf "a\nbb\nccc\nddd\nee\nf\nggg" | ./a.out ccc ddd ggg