Make sure sample input ends with a newline