#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
template <class T>
T gcd(T a, T b) {
  return ((b == 0) ? a : gcd(b, a % b));
}
void solve() {
  string s;
  cin >> s;
  string ans = "";
  for (int i = 0; i < s.size(); i += 2) {
    ans += s[i];
  }
  ans += s[s.size() - 1];
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
