Problem Description

For each testcase you get string s. Repeatedly remove adjacent equal characters using a stack idea. Output final string (or EMPTY).

Input Format

First line t. Next t lines strings.

Output Format

t lines final strings.

Sample Test Case

Input:
3 aabbcc abba azxxzy
Output:
EMPTY EMPTY ay

Constraints

Total length

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next