Peanoland contacting Gaussland

When scientists in Peanoland discovered that the remote Gaussland planet was inhabited they rejoiced at knowing that they were not alone in the universe. Likewise, there were widespread celebrations in Gaussland when they discovered life in planet Peanoland. Joy did not last long as both planets realized how difficult it was for them to communicate. After many experiments they discovered that the best way to communicate was through basic light impulses and each planet independently developed its own ACIS table (think of it like an ASCII table but for interplanetary communications). Unfortunately, the ACIS table was not working and scientists simply could not figure out what they had done wrong. Enter the brilliant Dr. Albert C. Munchhausen whom, through a far bit of trial and error, noticed that communication problems were due to the usage of two different numerical systems. In Peanoland, they were using natural numbers N in their ACIS table. Gausslanites were instead using Gaussian integers, i.e. the set Z[i] = {a + b·i | a, b ∈ Z}, where i2 = −1. Consider Z[i] as subset of complex numbers: Z[i]⊂C “The communication problem is solved”, announced Dr. Munchhausen to his fellow Peanolanders, “because every number that we use in Peanoland has a corresponding number in Gaussland and we can use binary representations both to communicate and perform the conversion. Let me show you how ...”. Those were the last words of Dr. Munchhausen who was hit by a meteorite and never recovered. Desperately, scientists studied his notebooks and found the following note: If p∈N and g∈Z[i], then p and g are equivalent if and only if, there exist n∈N, b0∈{0,1}, b1∈{0,1}, ..., and bn∈{0,1}, such that ∑n bk·2k Another note said: 292 = 20 − 6·i Your task, to honor the memory of Dr. Munchhausen, is to build the translator that he intended to build in order to convert from the numbers used in Peanoland to the numbers used in Gaussland. Input The input consists of several test cases. Each test case consists of a line with a single natural number p in the Peanoland system (0 ≤ p < 109). Output For each test case output two blank-separated integers a and b, where g = a + b·i is the number in the Gaussian system that corresponds to the natural number p in the Peanoland system. p = k=0 and Eureka! g = ∑n k=0 bk·(i−1)k

2/2 Sample Input 0 1 2 3 4 292 999999999 Sample Output 00 10 -1 1 01 0 -2 20 -6 5290 -5347