This page is still under construction.

Parts of this page are still being built. What you see may change.

Numb

Time limit1sMemory limit512 MB

Summary
Build an n-digit binary string whose prefixes all leave distinct remainders mod n and whose whole value is divisible by n.
Level

Medium6 of 10

Topics
Greedy, Math, Number theory, Implementation
Solved
No attempts yet

Problem

You are given an even integer nn. Construct a binary number a=a1a2…an‾a = \overline{a_1 a_2 \ldots a_n} consisting of nn binary digits such that aa is divisible by nn, and all numbers a1a2…ai‾\overline{a_1 a_2 \ldots a_i} (the prefixes of aa in binary notation) for i=1,2,…,ni = 1, 2, \ldots, n have distinct remainders modulo nn.

Input

The only line of input contains an integer nn (2≤n≤10002 \le n \le 1000, nn is even).

Output

Print the desired number a1a2…an‾\overline{a_1 a_2 \ldots a_n} as a string of nn binary digits. Leading zeroes are disallowed. If there are several possible answers, print any one of them. It is guaranteed that at least one answer exists under these constraints.

Examples2

  1. Example 1

    Input
    2
    
    Expected output
    10
    
  2. Example 2

    Input
    4
    
    Expected output
    1100