#include <bits/stdc++.h>
using namespace std;
void solve() {
  int i;
  string b, a;
  cin >> b;
  int size = b.size();
  for (i = 0; i <= size - 1; i++) {
    a += b[i];
    i++;
  }
  a += b[size - 1];
  cout << a << '\n';
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  getline(cin, s);
  int _t = stoi(s);
  while (_t--) solve();
}
