#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int inf = INT_MAX;
const int MOD = 1e9 + 7;
void solve() {
  string s;
  cin >> s;
  string ans = "";
  int n = s.length();
  for (int i = 0; i < n; i += 2) {
    ans += s[i];
  }
  ans += s[n - 1];
  cout << ans << "\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
