Under construction

Still being built. Things may change

Electronic Lock

Interview

Time limit2sMemory limit1024 MB

Summary
Given at most n lit segments on a 7-segment display, print the largest natural number that can be shown.
Level

Easy3 of 10

Topics
Greedy, Math
Solved
No attempts yet

Problem

The traitors have locked the doors again. To open them, you need to enter a code.

The code entry field is an infinite sequence of 7-segment displays. The code is the largest natural number that can be shown using at most nn lit segments.

Fig. 2: Examples of how each digit is shown on a 7-segment display.

Help the team find the code.

Input

The first line contains one integer nn, the maximum number of lit segments used to display a number (2≤n≤100 0002 \le n \le 100\,000).

Output

Print one number, the required code.

Hint

Since the digit 1 has only two lit segments, the number 111 uses 6 lit segments in total.

Examples1

  1. Example 1

    Input
    6
    
    Expected output
    111