{"raw_statement":[{"iden":"problem statement","content":"You are given a positive integer $N$.\nFill each square of a grid with $N$ rows and $N$ columns by writing a positive integer not greater than $N^2$ so that all of the following conditions are satisfied.\n\n*   Two positive integers written in horizontally or vertically adjacent squares never sum to a prime number.\n*   Every positive integer not greater than $N^2$ is written in one of the squares.\n\nUnder the Constraints of this problem, it can be proved that such a way to fill the grid always exists."},{"iden":"constraints","content":"*   $3\\leq N\\leq 1000$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"4"},{"iden":"sample output 1","content":"15 11 16 12\n13 3 6 9\n14 7 8 1\n4 2 10 5\n\nIn this grid, every positive integer from $1$ through $16$ is written once. Additionally, among the sums of two positive integers written in horizontally or vertically adjacent squares are $15+11=26$, $11+16=27$, and $15+13=28$, none of which is a prime number."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}