#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string a;
    cin >> a;
    int s = a.length();
    cout << a[0];
    for (int i = 1; i < s; i += 2) {
      cout << a[i];
    }
    cout << '\n';
  }
}
