Domo is a brilliant dog hacker, he wants to find out the password of your computer.
Your password is a sequence of numbers, generated according to the following rules.
Given the number of N and R, we need to arrange the numbers from 1 to N in a continuous Z pattern, where the side length of Z pattern is R.
Here are examples of Z pattern with length 3, 4, and 5. We need to find out which pattern we need to use first.
Next, sequentially fill the numbers from 1 to N into the Z-pattern, starting from the top-left corner.
For example, the Z pattern seems like below when N = 14 and R = 4.
Finally, output each row from top to bottom.
Here's the password when N = 14 and R = 4.
Help Domo find the password, or he'll start getting angry with you.
The first line consists two number N (1 ≤ N ≤ 104) and R (2 ≤ R ≤ 10)
Output the corresponding password sequence, then print a newline character at the end.