#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t > 0) {
    t--;
    string s, x;
    cin >> s;
    x.push_back(s[0]);
    for (int i = 1; i < s.size(); i++) {
      if (i % 2 != 0) x.push_back(s[i]);
    }
    cout << x << endl;
  }
  return 0;
}
