#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int l = 0; l < n; l++) {
    string b;
    cin >> b;
    string a;
    a = b[0];
    string c;
    for (int i = 1; i <= b.length(); i += 2) {
      c = b[i];
      a += c;
    }
    cout << a << "\n";
  }
  return 0;
}
