提示: 欢迎访问OurACM平台。
Problem 1876 JinYueTuan

Accept: 130    Submit: 628
Time Limit: 2000 mSec    Memory Limit : 32768 KB

Problem Description

Let’s have a look at the picture below

Now, do you know what it’s? Yeah , O(∩_∩)O~ , It is the game called JinYueTuan. chjing plays it very often years ago. I promise you would like it too. Now I want to introduce it to you. Maybe you have already known it clearly. Just be patient.

JinYueTuan is a famous online game which has been in vogue for a long time. Since it is so exciting a game that a large number of players put themselves in it . Only seven keys on the keyboard will be used in games, each key are assigned to one of the seven sound tracks. During the game, a series of notes may fall in each sound track irregularly. When notes fall down in one sound track, player should press the assigned key at once. If so, then got a “Cool”, or get “Miss” otherwise. You should press the key when the note is almost disappeared at the bottom of the window. If you press the key too early, you will miss the note. There will be a song or some kind of music played when you are playing the game. So you will feel you are a pianist. As you pass a low level .the notes will be more and the speed the notes fall will be very high. And the game will be more exciting .There are a lot of cows who play this game very well. If you have a chance to watch them playing, you would say ‘orz’ from your heart. But as a programmer, we would admire people who write this game more. Here comes the problem.

If you are assigned write a game similar to this game. If there are n different sound tracks and m different notes. How many different ways can you arrange the notes to fall.

Input

There are multiple test cases, each case contains a line of three numbers n, m, p. (0 < n, m < 1000000, 0 < p < 10^10).

Output

Output the result mod p.

Sample Input

2 2 1000

Sample Output

6

Hint


We only care about the figure when the notes are piled up. So please ignore the sequence of the notes falling in different sound tracks.

Source

chjing

Submit  Back  Status  Discuss