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