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