#Z15202. 同行列对角线的格

同行列对角线的格

Description

Enter three natural numbers N, i, j (1 ≤ i ≤ n, 1 ≤ j ≤ n), and output the positions of all grid cells in an N*N chessboard (where rows and columns are numbered starting from 1) that are in the same row, same column, or same diagonal as the cell (i, j).

For example: n=4, i=2, j=3 represents the grid cell in the second row and third column of the chessboard.
When n=4, i=2, j=3, the output result is:

(2,1) (2,2) (2,3) (2,4) 同一行上格子位置
(1,3) (2,3) (3,3) (4,3) 同一列上格子位置
(1,2) (2,3) (3,4)       左上到右下对角线上格子的位置
(4,1) (3,2) (2,3) (1,4) 左下到右上对角线上格子的位置

Input Format

One line containing three natural numbers N, i, j, separated by single spaces (1 ≤ N ≤ 10).

Output Format

First line: Output all grid positions in the same row from left to right;
Second line: Output all grid positions in the same column from top to bottom;
Third line: Output all grid positions on the same diagonal from top-left to bottom-right;
Fourth line: Output all grid positions on the same diagonal from bottom-left to top-right.

Each grid position should be formatted as follows: (x,y), where x is the row number and y is the column number, using English punctuation with no spaces in between. Separate adjacent grid positions with a single space.

4 2 3

(2,1) (2,2) (2,3) (2,4)
(1,3) (2,3) (3,3) (4,3)
(1,2) (2,3) (3,4)
(4,1) (3,2) (2,3) (1,4)