#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  vector<string> ans(t);
  for (int i = 0; i < (int)(t); i++) {
    string b;
    cin >> b;
    string a;
    for (int j = 0; j < (int)(b.size() - 1); j++) {
      if (j % 2 == 0) a.push_back(b[j]);
    }
    a.push_back(b[b.size() - 1]);
    ans[i] = a;
  }
  for (int i = 0; i < (int)(t); i++) cout << ans[i] << endl;
}
