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