#include <bits/stdc++.h>
using namespace std;
bool isPrime[1000009];
void sieve(int N) {
  for (int i = 0; i <= N; ++i) {
    isPrime[i] = true;
  }
  isPrime[0] = false;
  isPrime[1] = false;
  for (int i = 2; i * i <= N; ++i) {
    if (isPrime[i] == true) {
      for (int j = i * i; j <= N; j += i) isPrime[j] = false;
    }
  }
}
void machayenge() {
  long long int t;
  cin >> t;
  while (t--) {
    string n;
    cin >> n;
    if (n.size() == 2) {
      cout << n << endl;
      continue;
    }
    string s = "";
    s += n[0];
    for (long long int i = 1; i < n.size() - 1; ++i) {
      s += n[i];
      i++;
    }
    s += n[n.size() - 1];
    cout << s << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  machayenge();
  return 0;
}
