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