Time limit
2s
Memory limit
128 MB
In base b, a digit string d_k d_{k-1} ... d_0 has value d_k×b^k + d_{k-1}×b^{k-1} + ... + d_0×b^0. Each d_i is a single digit between 0 and |b|-1, inclusive.
The same definition applies when b is negative. In a negative base, the signs of place values alternate, so negative integers can be represented without a - sign.
Given a decimal integer x and a base b, output the representation of x in base b. If b is negative, the output must not contain a - sign.
The first line contains two integers x and b, separated by a space.
Output the representation of x in base b on the first line.