#include <bits/stdc++.h>
using namespace std;
ostream& operator<<(ostream& os, const pair<long long, long long>& p) {
  os << p.first << ' ' << p.second << '\n';
  return os;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tt;
  cin >> tt;
  long long tmp = tt;
  while (tt--) {
    long long n = 0, m = 0, k = 0, x = 0, y = 0, z = 0, i = 0, j = 0;
    string str;
    char ch;
    cin >> str;
    string s;
    s += str[0];
    for (i = 1; i < str.length() - 1; i++) {
      s += str[i++];
    }
    s += str[str.length() - 1];
    cout << s;
    cout << '\n';
  }
  return 0;
}
