Input contains multiple test cases. Each test case starts with a number N (0 < N