#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string b, h, r;
  getline(cin, b);
  vector<string> a;
  for (int i = 0; i < n; i++) {
    getline(cin, b);
    r = "";
    for (unsigned int j = 0; j < b.length() - 1; j += 2) {
      h = "";
      h += b[j];
      h += b[j + 1];
      if (r == "")
        r += h;
      else
        r += h[1];
    }
    a.push_back(r);
  }
  for (int i = 0; i < n; i++) {
    cout << a[i];
    if (i != n - 1) cout << endl;
  }
  return 0;
}
