#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string b;
    cin >> b;
    int c = 1;
    string a = "";
    a += b[0];
    for (int i = 1; i < b.length() - 1; i++) {
      if (i % 2 == 0) {
        a += b[i];
        c++;
      }
    }
    a += b[b.length() - 1];
    cout << a << endl;
  }
  return 0;
}
