Superhero
There is a new superhero in the city of Minsk — HyperKirill! Every day he serves the city and prevents crime.
HyperKirill has been saving the city for days. On day number he prevented crimes, and the rate of Hyperruble in Minsk was equal to .
Since the Minsk authorities are grateful to HyperKirill, they decided to support him financially as follows: if the balance of HyperKirill is and the Hyperruble rate is , the balance of HyperKirill will be for one crime prevented.
HyperKirill doesn't have time to count his money, because the city can't save itself! Help him do it. Before he appeared in the city, his balance was .
Since the number may be large, output it modulo .
Input
The first line contains non-negative integer — number of days.
The second line contains non-negative integers — Hyperruble courses.
The third line contains non-negative integers — the number of crimes prevented.
Output
Output a single integer — the answer to the problem.