启示录
题号:NC51211
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

The number 666 is considered to be the occult “number of the beast” and is a well used number in all major apocalypse themed blockbuster movies. However the number 666 can’t always be used in the script so numbers such as 1666 are used instead. Let us call the numbers containing at least three contiguous sixes beastly numbers. The first few beastly numbers are 666, 1666, 2666, 3666, 4666, 5666…

Given a 1-based index n, your program should return the nth beastly number.

输入描述:

The first line contains the number of test cases .
Each of the following T lines contains an integer as a test case.


输出描述:

For each test case, your program should output the nth beastly number.
示例1

输入

复制
3
2
3
187

输出

复制
1666
2666
66666