cho.sh
Notes
Loading...

Block Stacking

Time limit

2s

Memory limit

128 MB

Problem

There is a rectangular box of size A x B x C. Its base is an A-row by B-column grid, and each cell may contain a vertical stack of 0 to C unit blocks of size 1 x 1 x 1.

The height of every cell must satisfy these conditions.

  1. If a cell has a cell to its left, its height cannot be greater than the height of that left cell.
  2. If a cell has a cell above it, its height cannot be greater than the height of that upper cell.

A cell may also contain no blocks. Given A, B, and C, compute the number of possible block arrangements.

Input

The first line contains three integers A, B, and C.

Output

Print the number of possible block arrangements modulo 1,000,000,000,000,000,000.

Constraints

  • 1 <= A <= 20
  • 1 <= B, C <= 6