#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t-- > 0) {
    string b;
    cin >> b;
    int len = b.length();
    cout << b[0];
    for (int i = 1; i < len; i += 2) cout << b[i];
    cout << "\n";
  }
}
