Harry is a Junior middle student. He is very interested in the story told by his mathematics teacher about the Yang Hui triangle in the class yesterday. After class he wrote the following numbers to show the triangle our ancestor studied.

1 | ||||||||||||||

1 | 1 | |||||||||||||

1 | 2 | 1 | ||||||||||||

1 | 3 | 3 | 1 | |||||||||||

1 | 4 | 6 | 4 | 1 | ||||||||||

1 | 5 | 10 | 10 | 5 | 1 | |||||||||

1 | 6 | 15 | 20 | 15 | 6 | 1 | ||||||||

1 | 7 | 21 | 35 | 35 | 21 | 7 | 1 | |||||||

…… |

There are multiple test cases in the input file. Each test case contains two numbers *P* and *N*, (*P* < 1000, *N* ≤ 10^{9}), where *P* is a prime number and *N* is a positive decimal integer.*P* = 0, *N* = 0 indicates the end of input file and should not be processed by your program.

提交代码