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