#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  string b;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> b;
    if (b.size() > 2) {
      string::iterator it = b.begin() + 2;
      while (it != b.end()) {
        it = b.erase(it);
        it++;
      }
    }
    cout << b << endl;
  }
  return 0;
}
