p00111 Doctor's Memorable Codes
Hiroshi:? D-C'KOPUA

Peter: What's wrong, Dr. David? I'm used to shouting something I don't understand, but I'm not even writing it today.

Hiroshi: Here.

<image>


Peter: What? This table ... oh, there was something like this in the qualifying question. Replacing characters using a table reduces the number of characters. I don't think I'm willing to give the same problem in the qualifying and the final and cut corners.

Hiroshi: It's the other way around.

Peter: Reverse? I see, is it a problem to get the shortened string back? That means that you can replace the letters "? D-C'KOPUA" from "letter" to "sign" using this table ...


11111 00011 11101 00010 11110 01010 01110 01111 10100 00000


Hiroshi: Umm. Next is this.

<image>


Peter: Yeah, there was also a table like this. Since this is used in reverse, you can replace "sign" with "character". But at first it is "11111", but it's not in the table, right?

Hiroshi: In that case, try making it shorter or connecting it to the back.

Peter: Then shorten it ... Oh, there is "111". Then it is "P" at first. Then, the rest is "11", but since this does not fit exactly, you can borrow one character from the next "00011" and make it "110".

Hiroshi: That's right. In other words, it's "E".

Peter: That's what remains of "0011", so I borrowed this from the next and changed it to "00111" and said "T" ... I've done it all. You should throw away the last "0000", right?

<image>


Hiroshi: That's right. Next is this.


? D-C'?-C'-LMGZN? FNJKN- WEYN? P'QMRWLPZLKKTPOVRGDI


Hiroshi: Furthermore, this is it.


? P'QNPY? IXX? IXXK.BI -G? R'RPP'RPOVWDMW? SWUVG'-LCMGQ


Hiroshi: Let's finish it.


? P'QMDUEQ GADKOQ? SWUVG'-LCMG? X? IGX, PUL.? UL.VNQQI


Peter: It's a hassle. Doctor, please make your own program this time.

So, instead of the doctor, create a program that replaces the above sentence.



Input

Given multiple datasets. For each dataset, one string (a string of 200 characters or less consisting of the characters contained in the table) is given on one line. Please process until the end of the input. The number of datasets does not exceed 200.

Output

For each data set, output the converted character string on one line.

Example

Input

?D-C'KOPUA


Output

PETER POTTER
```python
import sys
def cv1(c):
    o=ord(c)
    if 65<=o<=90:
        return format(o-65,"05b")
    elif o==32:
        return "11010"
    elif o==46:
        return "11011"
    elif o==44:
        return "11100"
    elif o==45:
        return "11101"
    elif o==39:
        return "11110"
    elif o==63:
        return "11111"

d={"101":" ",
   "000000":"'",
   "000011":",",
   "10010001":"-",
   "010001":".",
   "000001":"?",
   "100101":"A",
   "10011010":"B",
   "0101":"C",
   "0001":"D",
   "110":"E",
   "01001":"F",
   "10011011":"G",
   "010000":"H",
   "0111":"I",
   "10011000":"J",
   "0110":"K",
   "00100":"L",
   "10011001":"M",
   "10011110":"N",
   "00101":"O",
   "111":"P",
   "10011111":"Q",
   "1000":"R",
   "00110":"S",
   "00111":"T",
   "10011100":"U",
   "10011101":"V",
   "000010":"W",
   "10010010":"X",
   "10010011":"Y",
   "10010000":"Z"
    }

sk=sorted(d.keys(),key=lambda x:len(x))   
for t in sys.stdin:
    cn=0
    st=""
    ta="".join([cv1(i) for i in t[:-1]])
    tmp=""
    for i in ta:
        tmp+=i
        if tmp in d:
            st+=d[tmp]
            tmp=""
    print(st)


```