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