#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n > 0) {
    char ch[100];
    cin >> ch;
    cout << ch[0];
    int i = 0;
    for (i = 1; ch[i + 1] != '\0'; i += 2) {
      cout << ch[i];
    }
    cout << ch[i];
    n--;
    cout << endl;
  }
}
