<?php $n = trim(fgets(STDIN)); while($n) { echo trim(fgets(STDIN)); $n--; }