The desired quantity
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
For a given non-negative p-ary number to determine its value modulo (p-1). The answer to give the p-ary system, without leading zeros.
Input
The first line contains the number of p (2 ≤ p ≤ 10). In the second line write the specified number of p-ary form, consisting of no more than 1000 bits, with no leading zeros.
Output
The output file a unique number in the p-ary form - answer the problem.
Examples
Input #1
Answer #1
Submissions 251
Acceptance rate 57%