#include <bits/stdc++.h>
using namespace std;
void solve() {
  int i, len;
  string str;
  cin >> str;
  len = str.length();
  for (i = 0; i < len; i = i + 2) {
    cout << str[i];
  }
  if (i == len) cout << str[len - 1];
  cout << endl;
  return;
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tests;
  cin >> tests;
  while (tests--) solve();
  return 0;
}
