#CCBCHBA0000101. Lưới số theo hàng (Row-Major Number Grid)

Lưới số theo hàng (Row-Major Number Grid)

Row-Major Number Grid

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given a grid of hh rows and ww columns, fill integers 1 through h×wh\times w in row-major order (left to right, top to bottom). Print the grid, with one space between adjacent numbers and no trailing spaces.

Input

One line contains integers h,wh,w, number of rows and columns respectively.

Output

Print hh lines of exactly ww numbers each in row-major order.

Subtasks

  • Subtask 1 (20%): 1≤h,w≤31\le h,w\le 3.

  • Subtask 2 (30%): 1≤h,w≤151\le h,w\le 15.

  • Subtask 3 (50%): 1≤h,w≤1001\le h,w\le 100.

Examples

Example 1

Input:

2 3

Output:

1 2 3
4 5 6

Explanation:

Values increase from left to right and continue at the beginning of the following row. For this sample, the input is 2 3; the displayed rows follow these rules exactly.

Example 2

Input:

1 4

Output:

1 2 3 4

Explanation:

Values increase from left to right and continue at the beginning of the following row. For this sample, the input is 1 4; the displayed rows follow these rules exactly.