// editor3
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
    char str[100];
    scanf("%s",str);
    if(!isalpha(str)&&!isdigit(str)){
        printf("Invalid input\n");
        return 0;
    }
    for(int i=0;str[i]!='\0';i++){
        for(int j=i+1){
            if(str[i]!=str[j]){
                break;
            }
            j++;
        }
        printf("%c",str[i]);
    }
}