In a $3 \times 3$ grid, there are four $2 \times 2$ subgrids, each of which is bordered by a thick line in one of the four grids below.
![](https://cdn.mathpix.com/cropped/2024_04_17_d13f9eaf1d614231018ag-2.jpg?height=254&width=1134&top_left_y=1346&top_left_x=554)

Kasun wants to place an integer from 1 to 4 inclusive in each cell of a $3 \times 3$ grid so that every $2 \times 2$ subgrid contains each integer exactly once. For example, the grid below and on the left satisfies the condition, but the grid below and on the right does not. In how many ways can Kasun place integers in the grid so that they satisfy the condition?

| 1 | 2 | 3 |
| :--- | :--- | :--- |
| 3 | 4 | 1 |
| 1 | 2 | 3 |


| 1 | 3 | 2 |
| :--- | :--- | :--- |
| 2 | 4 | 1 |
| 1 | 3 | 3 |
Suppose $a, b, c$, and $d$ are the digits 1 through 4 in some order and are placed in the top-left subgrid as shown below.

| $a$ | $b$ |  |
| :--- | :--- | :--- |
| $c$ | $d$ |  |
|  |  |  |

In order for the bottom-left subgrid to contain the integers from 1 through 4, the leftmost two cells in the bottom row must contain $c$ and $d$ in some order. Similarly, in order for the top-right subgrid to contain the digits from 1 through 4, the third cells in the first two rows must contain $a$ and $c$ in some order.

Therefore, there are four possible ways to fill in the rest of the cells, excluding the bottom-right cell. They are shown below.

| $a$ | $b$ | $a$ |
| :--- | :--- | :--- |
| $c$ | $d$ | $c$ |
| $a$ | $b$ |  |


| $a$ | $b$ | $c$ |
| :--- | :--- | :--- |
| $c$ | $d$ | $a$ |
| $a$ | $b$ |  |


| $a$ | $b$ | $a$ |
| :--- | :--- | :--- |
| $c$ | $d$ | $c$ |
| $b$ | $a$ |  |


| $a$ | $b$ | $c$ |
| :--- | :--- | :--- |
| $c$ | $d$ | $a$ |
| $b$ | $a$ |  |

In each of these four grids, the top-left, top-right, and bottom-left subgrids all satisfy the condition that each digit occurs exactly once in it.

In the first three of four, the three digits already in the bottom-right subgrid are different, so there is exactly one way to place a digit in the bottom right cell to make the grid satisfy the condition.

For the first of the four grids above, we need to place $a$ in the bottom-right cell. For the second, we need to place $c$. For the third, we need to place $b$.

The fourth of these grids lacks $b$ and $c$ in the bottom-right subgrid. With only one cell left to fill, there is no way to place a digit in it so that every digit occurs in the subgrid.

There are 24 ways to order the digits from 1 through 4 as $a, b, c$, and $d$. We have shown that there are three ways to fill the grid for each of these 24 orderings, so the answer is $3 \times 24=72$.

ANSWER: 72