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