#Q198. 「一本通 6.1 练习 3」越狱

「一本通 6.1 练习 3」越狱

Description

Original Source: HNOI 2008

A prison has a sequence of nn rooms numbered consecutively from 11 to nn, each housing one prisoner. There are mm different religions, and each prisoner may follow one of them. If two adjacent prisoners share the same religion, an escape attempt may occur. Calculate the number of possible states where an escape could happen.

Input Format

Input two integers, mm and nn.

Output Format

The number of possible escape states, modulo 100003100003.

Sample 1

All possible 66 states are: $\{0,0,0\},\{0,0,1\},\{0,1,1\},\{1,0,0\},\{1,1,0\},\{1,1,1\}$.

2 3

6

Constraints and Hints

For all test cases, 1m1081\le m\le 10^8 and 1n10121\le n\le 10^{12}.