eolymp
bolt
Try our new interface for solving problems
Problems

The desired quantity

The desired quantity

For a given non-negative \textbf{p}-ary number to determine its value modulo (\textbf{p-1}). The answer to give the \textbf{p}-ary system, without leading zeros. \InputFile The first line contains the number of \textbf{p} (\textbf{2} ≤ \textbf{p} ≤ \textbf{10}). In the second line write the specified number of \textbf{p}-ary form, consisting of no more than \textbf{1000} bits, with no leading zeros. \OutputFile The output file a unique number in the \textbf{p}-ary form - answer the problem.
Time limit 1 second
Memory limit 64 MiB
Input example #1
10
123456781987654321
Output example #1
1