#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, i;
  cin >> t;
  while (t--) {
    string b;
    cin >> b;
    int k = b.length();
    if (k == 2)
      cout << b;
    else {
      cout << b.at(0);
      for (i = 1; i < k; i += 2) cout << b.at(i);
    }
    cout << "\n";
  }
  return 0;
}
