#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j;
  cin >> t;
  getchar();
  string s1;
  while (t--) {
    getline(cin, s1);
    if (s1.length() == 2) {
      cout << s1 << endl;
      continue;
    } else {
      cout << s1[0] << s1[1];
      for (i = 4; i < s1.length();) {
        cout << s1[i];
        i += 2;
      }
      cout << s1[s1.length() - 1];
    }
    cout << endl;
  }
}
