Problem:
Score : 300 points

Problem Statement

Given an integer N, find the base -2 representation of N.

Here, S is the base -2 representation of N when the following are all satisfied:

S is a string consisting of 0 and 1.

Unless S = 0, the initial character of S is 1.

Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ... + S_k \times (-2)^k = N.

It can be proved that, for any integer M, the base -2 representation of M is uniquely determined.

Constraints

Every value in input is integer.

-10^9 \leq N \leq 10^9

Input

Input is given from Standard Input in the following format:

N

Output

Print the base -2 representation of N.

Sample Input 1

-9

Sample Output 1

1011

As (-2)^0 + (-2)^1 + (-2)^3 = 1 + (-2) + (-8) = -9, 1011 is the base -2 representation of -9.

Sample Input 2

123456789

Sample Output 2

11000101011001101110100010101

Sample Input 3

0

Sample Output 3

0

Solution in C# (Mono 4.6.2.0) (judge verdict: Runtime Error)

using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{

    public static void Main()
    {
        int N = intRead();
        int box = 0;
        int max = Solve(N);
        HashSet<int> ans = new HashSet<int>();
        ans.Add(max);
        while (N != 0)
        {
            box = Solve(N);
            N = N - int.Parse(Math.Pow(-2, box).ToString());
            ans.Add(box);
        }
        for (int i = ans.First(); i != -1; i--)
        {
            if (ans.Contains(i))
            {
                Console.Write("1");
            }
            else Console.Write("0");
        }
        Console.WriteLine();
        return;
    }

    public static int Solve(int N)
    {
        int max_L = 0;

        if (N > 0)
        {
            int max = 0;
            for (int i = 0; i < 32; i += 2)
            {
                max += int.Parse((Math.Pow(2, i)).ToString());
                if (max >= N)
                {
                    max_L = i;
                    break;
                }
            }
        }
        else if (N < 0)
        {
            N *= -1;
            int min = 0;
            for (int i = 1; i < 32; i += 2)
            {
                min += int.Parse((Math.Pow(2, i)).ToString());
                if (min >= N)
                {
                    max_L = i;
                    break;
                }
            }
        }

        return max_L;
    }
}


public class Atcoder
{
    static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static long LCM(long a, long b)
    {
        long c = a * b;
        if (a < b) Swap(ref a, ref b);
        long d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return c / b;
    }
    public static string strReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static int intRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static int[] SpIntRead(char c)
    {
        return Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
    }
    public static string ToConvertBit(int N, int e)
    {
        string ret = "";
        int r = 0;
        while (N != 0)
        {
            r = N % e;
            ret += r.ToString();
            N -= r;
            N /= e;
        }
        ret = strReverce(ret);
        return ret;
    }

}