Tile a rectangular grid completely using dominoes and trominoes.
A domino consists of two unit squares joined along an edge. Both of the following types of trominoes are available.
Tiles may be rotated to align with the grid, and an unlimited number of each type is available. Tiles must not overlap or extend outside the grid.
Find the number of tilings modulo . Two tilings are different if their collections of cell sets occupied by individual tiles are different. Tiles of the same shape are indistinguishable.
The input is given in the following format:
Print the number of tilings modulo .
There are tilings using only dominoes, using two L-shaped trominoes, and using two straight trominoes.