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