#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  cout << s[0];
  for (int i = 1; i < s.size() - 1; i += 2) {
    cout << s[i];
  }
  cout << s.back();
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t_;
  cin >> t_;
  while (t_--) solve();
  return 0;
}
