#include <bits/stdc++.h>
using namespace std;
int n, m, t, i, j, k, x, y, z;
int main() {
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    for (i = 0; i < s.size(); i += 3) {
      cout << s[i++] << s[i];
    }
    if (s.size() % 4 == 0) cout << s[s.size() - 1];
    cout << endl;
  }
}
