Wrong Answer with and without the last '\n'