Under construction

Still being built. Things may change

Many LCS

Time limit4sMemory limit1024 MB

Summary
Given K, construct two binary strings of length at most 8848 that have exactly K distinct longest common subsequences.
Level

Hard8 of 10

Topics
Combinatorics, Dynamic programming, String
Solved
No attempts yet

Problem

Given KK, construct two non-empty binary strings SS and TT of length at most 8848 such that they have exactly KK different longest common subsequences. More formally, if LL is the length of the longest common subsequence of SS and TT, there should exist exactly KK distinct binary strings of length LL which are subsequences of both SS and TT.

It is guaranteed that under the constraints of this problem such strings always exist.

Input

The only line of input contains a single integer KK (1≤K≤1091 \le K \le 10^9).

Output

Print non-empty binary strings SS and TT on separate lines. The length of each of them should not exceed 8848. They can have different lengths.

If there is more than one solution, you can print any one of them.

Hint

In the first example, the longest common subsequence of 1111 and 00 has length 0, and there is only one string of length 0 that is a subsequence of both, the empty string.

In the second example, the longest common subsequence of 10 and 01 has length 1, and there are 2 strings of length 1 that are subsequences of both SS and TT: 0 and 1.

In the third example, the longest common subsequence of 010 and 1001 has length 2, and there are 3 strings of length 2 that are subsequences of both SS and TT: 00, 01, and 10.

It would be disrespectful to make strings longer than Everest...

Examples4

  1. Example 1

    Input
    1
    
    Expected output
    1111
    00
    
  2. Example 2

    Input
    2
    
    Expected output
    10
    01
    
  3. Example 3

    Input
    3
    
    Expected output
    010
    1001
    
  4. Example 4

    Input
    100
    
    Expected output
    10001000001011100001010100011
    11000010001010101001010011100