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