#include <bits/stdc++.h>
using lli = long long int;
using namespace std;
void solve() {
  string s;
  cin >> s;
  if (s.size() == 2) {
    cout << s << endl;
    return;
  }
  cout << s[0];
  lli len = s.size();
  for (lli i = 1; i < len; i += 2) {
    cout << s[i];
  }
  cout << endl;
  return;
}
int main() {
  lli test_case;
  cin >> test_case;
  while (test_case--) solve();
  return 0;
}
