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