------
## 最终结论
```python
def max_displayable_integer(t, test_cases):
    results = []
    
    for n in test_cases:
        if n % 2 == 1:
            max_number = '7'
            n -= 3
        else:
            max_number = ''
        
        max_number += '1' * (n // 2)
        
        results.append(max_number)
    
    return results

# Read input
t = int(input().strip())
test_cases = [int(input().strip()) for _ in range(t)]

# Get the results
results = max_displayable_integer(t, test_cases)

# Print the results
for result in results:
    print(result)
```