#include <stdio.h>

unsigned sazmi(unsigned x){
	unsigned sx;
	if(x==0)
		return 0;
	sx = sazmi(x/10);
	if(sx%10!=x%10)
		return sx*10+x%10;
	else
		return sx;
}

int main(){
	unsigned x;
	scanf("%u", &x);
	printf("%u\n", sazmi(x));
	return 0;
}
