#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1;
  int tc;
  cin >> tc;
  getchar();
  while (tc--) {
    cin >> s1;
    for (int i = 0; i < s1.length(); i += 2) {
      cout << s1[i];
    }
    cout << s1[s1.size() - 1] << endl;
  }
}
