#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l, n, m;
  string a, b;
  cin >> m;
  while (m--) {
    cin >> a;
    b = a[0];
    b += a[1];
    for (i = 3; i < a.length(); i += 2) {
      b += a[i];
    }
    cout << b << endl;
  }
  return 0;
}
