#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m, k, x, y, z, cnt;
  string str, ans = "";
  cin >> str;
  for (long long i = 0; i < str.size(); i += 2) ans += str[i];
  ans += (str.back());
  cout << ans << '\n';
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
