#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353;
signed main() {
  long long int t;
  cin >> t;
  while (t--) {
    string b;
    cin >> b;
    string a = "";
    a += b[0];
    long long int i = 1;
    while (i < b.size()) {
      a += b[i];
      i = i + 2;
    }
    cout << a << "\n";
  }
  return 0;
}
