Discover the rule used for the filled cells and complete the table. What is the value of A?

| 0 | 1 | 2 | 3 | 4 |
| :---: | :---: | :---: | :---: | :---: |
| 1 | 2 | 5 | 10 |  |
| 2 |  |  |  |  |
| 3 |  |  |  |  |
| 4 |  |  |  | $\mathbf{A}$ |
Observe that in each square formed by four smaller squares, the number at the bottom right is the sum of the other three numbers. Thus, we fill in the table.

| 0 | 1 | 2 | 3 | 4 |
| :---: | :---: | :---: | :---: | :---: |
| 1 | 2 | 5 | 10 | $3+4+10=17$ |
| 2 | $1+2+2=5$ | $2+5+5=12$ | $5+10+12=27$ | $10+17+27=54$ |
| 3 | 10 | 27 | 66 | 147 |
| 4 | 17 | 54 | 147 | $\mathbf{A}$ |

Therefore:

$$
\mathbf{A}=66+147+147=360
$$