#include <bits/stdc++.h>
using namespace std;
long long int a[4000008];
long long int cnt[3][4000008];
int main() {
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int n, m, k;
    string s;
    cin >> s;
    string str = "";
    str += s[0];
    str += s[1];
    if (s.size() <= 2) {
      cout << str << endl;
      continue;
    }
    if (s.size() == 4) {
      cout << s[0] << s[1] << s[3] << endl;
      continue;
    }
    for (int i = 3; i < s.size() - 4; i += 2) {
      str += s[i];
    }
    long long int sz = s.size();
    str += s[sz - 2];
    str += s[sz - 1];
    cout << str << endl;
  }
}
