#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 7;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    for (long long i = 0; i < s.size(); i += 2) cout << s[i];
    cout << s[s.size() - 1];
    cout << endl;
  }
}
