13296 - Mop the Floor Ⅱ   

Description

The floor in Winnie the Pooh’s house is made of N row *M column square woods. 

Today, Winnie wants to mop the floor.

Winnie is standing on the wooden floor in the upper right corner at the beginning, and his big belly can mop 1 or 2 adjacent pieces of wood at the same time. 

Besides, Winnie is a lazy bear, so the next starting position must be adjacent to the last end one.

In problem 13261 - Mop the Floor, we know the answer that the times he need to clean the entire house at least is (n*m+1)/2.

And one strategy is that he goes clockwise.

So please print the position of each step follow the strategy that he goes clockwise.

Input

In a single line you are given two integers and M  (1 ≤ N≤ 2500).

 

Output

(n*m+1)/2 line — the position of each step. note you should add '\n' in the last line.

Sample Input  Download

Sample Output  Download

Tags




Discuss