#include <bits/stdc++.h>
using namespace std;
long long BSDK() {
  int j;
  string s, s1;
  cin >> s1;
  s = s1.substr(0, 2);
  for (j = 3; j < s1.length(); j += 2) {
    s += s1[j];
  }
  cout << s;
  return 0;
}
int main() {
  int t, i;
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    BSDK();
    printf("\n");
  }
}
