Write a program that reduces the size of programs written in Python (without using some of the features of the language).

The program reads the number of lines, then - these lines themselves in turn. Each line is output, but in a modified form:

if several spaces are followed in a row not at the beginning of a line, then only one space should be left; if the comment character # is encountered, then it is not necessary to output it and everything behind it; if extra spaces or a comment character are found inside (single) quotes, then you do not need to remove or change anything in them; if there is another quote after the quotes, then it closes the first one only if there is no backslash in front of it, not escaped by another backslash (it is guaranteed that there is no backslash outside the quotes and comments). If the input and output of the program is carried out through the same console, the input and output will be mixed; this does not prevent the separation of input and output during the automatic check, so do not need to worry about it.

Input format

The first line is the number of lines in the program. Next - the program itself.

Output format

The program, abbreviated by the rules described in the condition.

Example

Input

6 easy = 2 + 2 if easy == 4:# А вдруг нет? print('Квадрат с обрезанными углами:') print('/-\\') print('|#|') print('\\_/') 

Conclusion

 easy = 2 + 2 if easy == 4: print('Квадрат с обрезанными углами:') print('/-\\') print('|#|') print('\\_/') 

I am new to python, and I can’t deal with some of the conditions in this problem. Code:

 n = int(input()) for i in range(n): st = input() count = 0 line = '' if '#' in st: for r in range(len(st)): if st[r] == '#': st = st[:r] break for k in range(len(st)): if k == 0 and k == len(st) - 1: continue if st[k] == ' ' and st[k - 1] != ' ': line += st[:k] + ' ' elif st[k] == ' ' and st[k + 1] != ' ': line += st[k + 1:] print(line) 

    0