#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    string s;
    cin >> s;
    int len = s.length();
    string res;
    for (int i = 0; i < len; i += 2) res += s[i];
    if ((len & 1) == 0) {
      res += s[len - 1];
    }
    cout << res << endl;
  }
}
