#include <bits/stdc++.h>
using namespace std;
void print(vector<int> vec) {
  for (int i = 0; i < (int)(vec.size()); ++i) {
    printf("%d ", vec[i]);
  }
  printf("\n");
}
void print(int* arr, int n) {
  for (int i = 0; i < (int)(n); ++i) {
    cout << arr[i] << " ";
  }
  cout << "\n";
}
void print(vector<pair<int, int>> vec) {
  for (int i = 0; i < (int)(vec.size()); ++i) {
    printf("%d %d", vec[i].first, vec[i].second);
  }
  printf("\n");
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  int t;
  cin >> t;
  while (t--) {
    string str;
    cin >> str;
    int cnt = 0;
    if (str.length() == 2) {
      cout << str << "\n";
      continue;
    }
    cout << str[0];
    for (int i = 1; i < str.length(); i += 2) {
      cout << str[i];
    }
    cout << "\n";
  }
  return 0;
}
