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