#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<long long>;
using vvi = vector<vector<int> >;
using vb = vector<bool>;
using pii = pair<int, int>;
const ll mod = 1e9 + 7;
template <typename T>
void take_input(vector<T> &a, int size) {
  T tmp;
  for (int i = 0; i < size; i++) {
    cin >> tmp;
    a.push_back(tmp);
  }
}
template <typename T>
void print_vector(vector<T> v) {
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string b;
    cin >> b;
    string a;
    for (int i = 0; i < b.size(); i++)
      if (i % 2 == 1 || i == 0) a.push_back(b[i]);
    cout << a << endl;
  }
}
