#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  string ans = "";
  ans += s[0];
  ans += s[1];
  for (int i = 3; i < s.size(); i = i + 2) ans += s[i];
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tc = 0;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
