#P7969. NJU emulator(无SPJ)

NJU emulator(无SPJ)

当前没有测试数据。

NJU emulator

Problem Description

"Dr.JYY, s86 instruction set, and NEMU, what should that remind you of?" "Oh, no..." NJU Emulator(a.k.a, NEMU) is the latest s86 architecture simulator developed by Dr. JYY. s86 is stack-style computer architecture, with its machine instructions only operating on the top element of the stack. The computation model of s86 includes a stack and a program of finite length. Each element in the stack is in 6464-bit unsigned integer type; We denote the stack as SS and size of the stack as size(S)size(S), then the program consists of the instructions in the following table and must end with a terminating instruction. When the s86 machine is running, the stack will first be initialized to empty, and then each instruction in the program will be executed in sequence until the last one is executed. After an end instruction, the machine will output the top element of the stack and halt. In the table, the xxth element refers to the xxth element from the top to the bottom of the stack, where the topmost element is the 00th element. Notably, all arithmetic operations(add, sub, mul) in the s86 instructions should be done modular 2642^{64}, i.e., when the arithmetic operation has a result of XX, the result in the s86 instruction set should be X(0X<264)X'(0\leq X'<2^{64}), and XXX-X' is a multiple of 2642^{64}, it can be shown that such XX' exist for any integer XX. Now that Dr. JYY has finished the development of NEMU. To test the correctness of NEMU, Dr. JYY wants you to write a program using s86 instructions, so that when the program halts, it should output the given integer NN.

Input

The first line contains a number T(1T10000)T(1\leq T\leq 10000), denoting the number of test cases. Each test contains an integer N(0N<264)N(0\leq N< 2^{64)} in one line, denoting the number your program should output when halts.

Output

For each test case, you should output a piece of program consisting of s86 instructions in the form as in the table in the statement so that when your program halts, it should output the given integer NN. Also, your program should contain at most 50 s86 instructions. It is guaranteed that there exists at least one such program under the limits of this problem. If any restriction in the instruction table is violated during the execution of your program, your answer would be considered incorrect. If many programs satisfy the restriction, you should output any such program, which will be considered correct.

Sample Input

3

2

0

18446744073709551615

Sample Output

p1

add 0

end

p1

dup

sub 1

end

p1

dup

add 1

swap

sub 1

end

Hint

The process of the execution of the last test case in the sample output is shown in the following table.

Source

2021“MINIEYE杯”中国大学生算法设计超级联赛(9)