#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 1;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1);
const double DEG = 180 / PI;
const int MOD = 1e9 + 7;
int mod(int x, int m) {
  if (x >= 0) return x % m;
  if (-x < m) return m - (-x);
  return mod(x % m, m);
}
int gcd(int a, int b) {
  while (b) {
    a = mod(a, b);
    swap(a, b);
  }
  return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int fexp(int base, int exp, int m) {
  int total = 1;
  while (exp > 0) {
    if (exp % 2 == 1) {
      total = mod(((mod(total, m)) * (mod(base, m))), m);
      exp--;
    }
    base = mod((mod(base, m) * mod(base, m)), m);
    exp /= 2;
  }
  return mod(total, m);
}
int n;
void solve() {
  string second;
  cin >> second;
  for (int i = 0; i < second.size(); i += 2) cout << second[i];
  cout << second[second.size() - 1];
  cout << '\n';
}
int32_t main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(0);
  int _;
  cin >> _;
  for (; _; --_) solve();
  return 0;
}
