#include <bits/stdc++.h>
using namespace std;
struct Interval {
  int start, end;
};
bool compareInterval(Interval i1, Interval i2) { return (i1.start < i2.start); }
long long int maxy(long long int a, long long int b) {
  if (b >= a) return b;
  return a;
}
long long int li[400003];
long long int ri[400003];
int main() {
  int t;
  long long int i, a, j, k, kk, m, b, c, d, sum, maxone, n, x, y, z, h;
  long long int ss[200003];
  Interval arr[3000];
  long long int s[100][100];
  cin >> t;
  char sos[100000];
  char asus[100000];
  while (t > 0) {
    cin >> sos;
    k = 0;
    for (i = 0; sos[i] != '\0'; i++) {
      k = k + 1;
    }
    asus[0] = sos[0];
    j = 1;
    for (i = 1; i < k - 1; i++) {
      asus[j] = sos[i];
      i = i + 1;
      j = j + 1;
    }
    asus[j] = sos[k - 1];
    asus[j + 1] = '\0';
    cout << asus << endl;
    t--;
  }
  return 0;
}
