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