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