#include <bits/stdc++.h>
using namespace std;
bool compare(pair<pair<long long int, long long int>, long long int> p1,
             pair<pair<long long int, long long int>, long long int> p2) {
  return p1.first.first < p2.first.first;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  long long int t, n, x, i;
  cin >> t;
  while (t--) {
    cin >> s;
    if (s.length() == 2)
      cout << s << "\n";
    else {
      cout << s[0];
      for (i = 1; i < s.length() - 1; i += 2) {
        cout << s[i];
      }
      cout << s[s.length() - 1] << "\n";
    }
  }
  return 0;
}
