#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
string s;
void input() { cin >> s; }
void solve() {
  cout << s.substr(0, 2);
  for (int i = 3; i < (int)s.size(); i += 2) cout << s[i];
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(16);
  cout << fixed;
  int t = 1;
  cin >> t;
  while (t--) {
    input();
    solve();
  }
}
