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