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