#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 0;
  cin >> t;
  while (t--) {
    vector<char> v;
    string b;
    cin >> b;
    int len = b.length();
    for (size_t i = 0; i < len; i++) {
      if (i % 2 == 0) {
        v.push_back(b[i]);
      }
    }
    v.push_back(b[len - 1]);
    for (auto i : v) {
      cout << i;
    }
    cout << endl;
  }
  return 0;
}
