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