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