#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long n = s.length();
    string ans = "";
    for (long long i = 0; i < n; i += 2) {
      ans += s[i];
    }
    ans += s[n - 1];
    cout << ans << "\n";
  }
}
