#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  string str[t];
  for (int x = 0; x < t; x++) {
    cin >> str[x];
  }
  int siz;
  for (int x = 0; x < t; x++) {
    siz = str[x].size() - 2;
    cout << str[x][0];
    for (int y = 1; y <= siz; y += 2) {
      cout << str[x][y];
    }
    cout << str[x][siz + 1] << endl;
  }
}
