#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int32_t main() {
  fast();
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    cout << s[0];
    long long n = s.length();
    for (long long i = 1; i < n; i = i + 2) {
      cout << s[i];
    }
    cout << endl;
  }
  return 0;
}
