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.
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.
The output file a unique number in the p-ary form - answer the problem.