Problem: Long ago during the Jurassic Park age, there was a company TopHunters, which used to conduct hunting competitions for the Dinosaurs around the world. Petrosaurus was believed to be the greatest hunter of that time and all other dinosaurs enjoyed watching the hunting videos posted by him in the forums ( yes, they had a website :) ). 
Many Indian dinosaurs used to post in sms language in the forums and annoy others. Vexosaurus was so annoyed reading the posts with numbers used in place of letters. He decided to correct all those posts, before the forums get Rusty. Could you please code for him and replace the following words in 1st column with their corresponding words in 2nd column




8ate
w8wait
gr8great
4for
b4before


     







Lets not make this complex and just replace the words when they appear entirely as a word themselves, and not as a subpart of bigger words ( see examples for clarity ). A word is a continuous sequence of non-space characters.
Disclaimer : This is just a fictional story. Any resemblance to real persons or company or dinosaurs is purely coincidental ;)


Input
First line contains T [ number of test cases, around 50 ]. Each of the next T lines contains a sentence with not more than 100 characters [ 'a' - 'z' , '0' - '9' , space ]. There can be 2 or more continuous spaces and you have to preserve them, in the output. Input sentence will not begin or end with a space.


Output
For each test case, output the corrected sentence, in a new line. 


Example

Input:
3
i 8 food b4
gr8 2 see you w8ing
1234   5678   9

Output:
i ate food before
great 2 see you w8ing
1234   5678   9

Solution (in PYTHON):

Solution:
# imports
import sys
import StringIO
import re

class Problem(object):
    def __init__(self, reader):        
        self.reader = reader

    def run(self):                
        ptn_8 = re.compile(r"\b8\b")
        ptn_w8 = re.compile(r"\bw8\b")
        ptn_gr8 = re.compile(r"\bgr8\b")
        ptn_4= re.compile(r"\b4\b")
        ptn_b4= re.compile(r"\bb4\b")

        test_cases = int(self.reader.readline().strip())
        for test_case in xrange(test_cases):
            post = self.reader.readline().strip()
            # replace sms with full words
            post = ptn_8.sub("ate",  post)
            post = ptn_w8.sub("wait",  post)
            post = ptn_gr8.sub("great",  post)
            post = ptn_4.sub("for",  post)
            post = ptn_b4.sub("before",  post)

            print post
            

# Main entry point
############################################################ 
if __name__ == "__main__":

    data = sys.stdin

    problem = Problem(data)
    problem.run()