spoj#HQNP. HQNP Incomputable

HQNP Incomputable

HQ9+ is an esoteric programming language specialized for certain tasks. For example, printing “Hello,world!” or writing a quine (a program that prints itself) couldn’t be any simpler. Unfortunately, HQ9+ doesn’t do very well in most other situations. This is why we have created our own variant of the language,HQ0-9+−INCOMPUTABLE?!.A HQ0-9+−INCOMPUTABLE?! program is a sequence of commands, written on one line without any whitespace (except for the trailing newline). The program can store data in two memory areas: the buffer, a string of characters, and the accumulator, an integer variable. Initially, the buffer is empty and the accumulator is set to 0. The value of the buffer after executing all the commands becomes the program’s output.

   
              HQ0-9+−INCOMPUTABLE?! supports the following commands:
commanddescription
hH

appends helloworld to the buffer

qQ

appends the program source code to the buffer (not including the trailing newline)

0-9

replaces the buffer with copies of its old value – for example, ‘2’ doubles the buffer

+

increments the accumulator

-

decrements the accumulator

iI

increments the ASCII value of every character in the buffer

nN

applies ROT13 to the letters and numbers in the buffer (for letters ROT13 preserves case; for digits we define ROT13(d) = (+ 13) mod 10)

cC

swaps the case of every letter in the buffer; doesn’t change other characters

oO

removes all characters from the buffer such that their index, counted from the end, is a prime or a power of two (or both); the last character has index 1 (which is a power of 2)

mM

sets the accumulator to the current buffer length

pP

removes all characters from the buffer such that their index is a prime or a power of two (or both); the first character has index 1 (which is a power of 2)

uU

converts the buffer to uppercase

tT

sorts the characters in the buffer by their ASCII values

aA

replaces every character in the buffer with its ASCII value in decimal (1–3 digits)

bB

replaces every character in the buffer with its ASCII value in binary (exactly eight ‘0’/‘1’ characters)

lL

converts the buffer to lowercase

eE

translates every character in the buffer to l33t using the following table: 
ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 
48(03=6#|JXLM~09Q257UVW%Y2 a6<d3f9hijk1m^0p9r57uvw*y2 O!ZEA$G/B9

?

removes 47 characters from the end of the buffer (or everything if it is too short)

!

removes 47 characters from the beginning of the buffer (or everything if it is too short)

command  description
         appends helloworld to the buffer
    h, H
         appends the program source code to the buffer (not including the trailing newline)
    q, Q
         replaces the buffer with n copies of its old value – for example, ‘2’ doubles the buffer
    0-9
         increments the accumulator
       +
         decrements the accumulator
       -
         increments the ASCII value of every character in the buffer
    i, I
         applies ROT13 to the letters and numbers in the buffer (for letters ROT13 preserves
    n, N
         case; for digits we define ROT13(d) = (d + 13) mod 10)
         swaps the case of every letter in the buffer; doesn’t change other characters
    c, C
         removes all characters from the buffer such that their index, counted from the end, is a
    o, O
         prime or a power of two (or both); the last character has index 1 (which is a power of 2)
         sets the accumulator to the current buffer length
    m, M
         removes all characters from the buffer such that their index is a prime or a power of two
    p, P
         (or both); the first character has index 1 (which is a power of 2)
         converts the buffer to uppercase
    u, U
         sorts the characters in the buffer by their ASCII values
    t, T
         replaces every character in the buffer with its ASCII value in decimal (1–3 digits)
    a, A
         replaces every character in the buffer with its ASCII value in binary (exactly eight ‘0’/‘1’
    b, B
         characters)
         converts the buffer to lowercase
    l, L
         translates every character in the buffer to l33t using the following table:
    e, E
         ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
         48(03=6#|JXLM~09Q257UVW%Y2 a6<d3f9hijk1m^0p9r57uvw*y2 O!ZEA$G/B9
         removes 47 characters from the end of the buffer (or everything if it is too short)
       ?
         removes 47 characters from the beginning of the buffer (or everything if it is too short)
       !

In this task you have to print the HQ0-9+−INCOMPUTABLE?! program that will give the number n as output.

Limits

Any HQ0-9+−INCOMPUTABLE?! program( output for each case ) must be at most 10 000 commands long. The accumulator is unbounded (it can store an arbitrarily large integer). After each command, the buffer must be at most 10 000 characters long. To prevent code injection vulnerabilities, during the execution of your program( output for each case ) the buffer must never contain non-alphanumeric characters, i.e. characters other than A-Z, a-z, and 0-9. If it happens, your solution will be judged as wrong.

 

   Input

First line has integer T i.e number of test cases. ( T <= 100 ). Next T lines has a number n. ( 0 <= n <= 10^100 )

 

   Output

For each n, output the required HQ0-9+−INCOMPUTABLE?! program which will give n as output. If there are multiple solutions, output any one of them. Output of each test case must be in a single line.

                                                                     

   Example

Input:

3

0

321

4124144

Output:

Find yourself :)

 

Following are some HQ0-9+−INCOMPUTABLE?! programs and their corresponding outputs:

h5!  rld
QCq  qcQQCq
q23  q23q23q23q23q23q23
h?h  helloworld
H2O  hlwolheo
h4op  ollwldwlhe
hint  ccfkrsvzzz
q18N  d41Ad41Ad41Ad41Ad41Ad41Ad41Ad41A
3QAh  518165104helloworld
Qb  0101000101100010
opaque  094QU3
h1Qt  1Qdehhllloortw
H9999 
 (error: buffer size exceeded 10 000)
quine  (error: buffer contains “|”)
LMAO

 (empty output)