#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  string b;
  while (t != 0) {
    cin >> b;
    string a = "";
    a += b[0];
    a += b[1];
    int i = 2;
    while (2 * i - 1 <= b.size() - 1) {
      a += b[i * 2 - 1];
      i++;
    }
    cout << a << endl;
    t--;
  }
}
