#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  string str;
  for (int i = 1; i <= t; i++) {
    cin >> str;
    string str1;
    str1.append(str, 0, 1);
    int j = 1, l = str.length();
    while (j < l) {
      str1.append(str, j, 1);
      j += 2;
    }
    cout << str1 << "\n";
  }
}
