#include <bits/stdc++.h>
const int MAXN = 100005;
char word[MAXN];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    memset(word, 0, sizeof(word));
    scanf(" %s", word);
    int len = strlen(word);
    printf("%c", word[0]);
    for (int i = 1; i < len - 1; i += 2) {
      printf("%c", word[i]);
    }
    printf("%c\n", word[len - 1]);
  }
  return 0;
}
