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