#include <bits/stdc++.h>
using namespace std;
void ans(vector<string>& a, int n) {
  int size = 0;
  vector<string> b;
  string c = "";
  int k;
  for (int i = 0; i < n; i++) {
    c += a[i][0];
    c += a[i][1];
    k = 2;
    size = a[i].length();
    for (int j = 3; j < size; j += 2) {
      c += a[i][j];
    }
    b.push_back(c);
    c = "";
  }
  for (int i = 0; i < n; i++) {
    cout << b[i] << "\n";
  }
  return;
}
int main() {
  int n;
  vector<string> a;
  cin >> n;
  string x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  ans(a, n);
}
