#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void) {
	// your code goes here
	char *s = (char*)malloc(sizeof(char) * 1000);
	char *s2 = (char*)malloc(sizeof(char) * 1000);
	
	while(!feof(stdin))	{
		//Doc cac tien to cua day so
		scanf("%[^]]", s);
		char temp;
		scanf("%c", &temp);
		strcat(s, (char*)(void*)&temp);
		printf("%s", s);
		
		//Doc day so
		scanf("%[^\[]", s2);
		printf("%s\n", s2);
	}
	
	return 0;
}
