#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  string a;
  cin >> t;
  while (t--) {
    cin >> a;
    for (int i = 0; i < a.length(); i++) {
      if (i == a.length()) {
        cout << a[i];
      }
      if (i % 2 == 0 && i != 0 && i != a.length()) {
        continue;
      } else {
        cout << a[i];
      }
    }
    cout << endl;
  }
}
