#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 7, NS = 2e3 + 7, lg = 20, sq = 550, inf = 1e9 + 7,
                mod = 1e9 + 7;
const long double eps = 1e-7;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long _;
  cin >> _;
  while (_--) {
    string s, l = "";
    cin >> s;
    for (long long i = 0; i < s.size(); i += 2) l += s[i];
    if (s.size() % 2 == 0) l += s[s.size() - 1];
    cout << l << endl;
  }
}
