#include <bits/stdc++.h>
using namespace std;
int main() {
  long int t;
  cin >> t;
  while (t--) {
    char str[1000];
    char str1[1000];
    cin >> str;
    long int len = strlen(str);
    len = len / 2;
    str1[0] = str[0];
    long int i = 1;
    long int c = 1;
    while (len--) {
      str1[c] = str[i];
      c += 1;
      i += 2;
    }
    str1[c] = '\0';
    cout << str1 << endl;
  }
  return 0;
}
