Wrote input reader. Just need a solution