#include <stdio.h>

int main(void) {
	int n, i;
	char s[101];
	scanf("%d", &n);
	while(n--){
		scanf("%s", s);
		i=0;
		while(s[2*i]){
			printf("%c",s[2*i]);
			s[i] = s[2*i+1];
			if(!s[i]){
				break;
			}
			i++;
		}
		s[i] = 0;
		printf("%s\n", s);
	}
	return 0;
}
