# Given a string, remove spaces from it.
#
# Example 1:
#
# Input:
# S = "geeks  for geeks"
# Output: geeksforgeeks
# Explanation: All the spaces have been
# removed.

# User function Template for python3

class Solution:
    def modify(self, s):
        # code here

        return s.replace(' ', '')


# {
#  Driver Code Starts
# Initial Template for Python 3

if __name__ == '__main__':
    t = int(input())
    for _ in range(t):
        s = input().strip()
        ob = Solution()
        ans = ob.modify(s)
        print(ans)
# } Driver Code Ends