#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j = 0, k;
  string str1;
  char str2[100];
  cin >> t;
  while (t--) {
    cin >> str1;
    int len = str1.length();
    for (i = 0; i < len; i += 2) {
      str2[j++] = str1[i];
    }
    str2[j++] = str1[len - 1];
    for (i = 0; i < j; i++) {
      cout << str2[i];
    }
    cout << endl;
    j = 0;
  }
  return 0;
}
