CF1295A Display The Number
Description
You have a large electronic screen which can display up to $ 998244353 $ decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of $ 7 $ segments which can be turned on and off to compose different digits. The following picture describes how you can display all $ 10 $ decimal digits:

As you can see, different digits may require different number of segments to be turned on. For example, if you want to display $ 1 $ , you have to turn on $ 2 $ segments of the screen, and if you want to display $ 8 $ , all $ 7 $ segments of some place to display a digit should be turned on.
You want to display a really large integer on the screen. Unfortunately, the screen is bugged: no more than $ n $ segments can be turned on simultaneously. So now you wonder what is the greatest integer that can be displayed by turning on no more than $ n $ segments.
Your program should be able to process $ t $ different test cases.
Input Format
N/A
Output Format
N/A