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