#Lutece0523. 循环移动

循环移动

Migrated from Lutece 523 循环移动

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

一群人排成一圈,按顺时针编号1,2,3,1,2,3,\ldots。然后顺时针移动mm次,编号又是怎样的。

Input

第一行有两个整数nnTTnn表示人数,TT表示测试的组数。下面是TT行整数,每行一个整数,表示移动次数mm1n201\le n\le 200m1000\le m\le 100

Output

共有TT行,每行对应移动后的人员编号,每个编号后有一个空格。

Samples

5 1
2
4 5 1 2 3

Resources

wxiaoping 2009年C语言第六次上机