#include <bits/stdc++.h>
using namespace std;
int gcd(int A, int B) {
  if (!B) return A;
  return gcd(B, A % B);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int n = s.length();
    cout << s[0];
    for (int i = 1; i < n; i += 2) cout << s[i];
    cout << endl;
  }
}
