#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    string a, b;
    cin >> a;
    int n = a.size();
    b = a[0];
    int j = 1;
    for (int i = 2; i <= n - 2; i += 2) {
      b += a[i];
    }
    b += a[n - 1];
    for (int i = 0; i < b.size(); ++i) cout << b[i];
    cout << endl;
  }
}
