#include <stdio.h>

int main(){
  int n,t=0,br=0,pom=0;
  scanf("%d",&n);
  
  while(n!=0){
    t=n%10;
    if(t!=(br%10))
      br=br*10+t;
    n=n/10;
  }
  
  while(br!=0){
    pom=pom*10+(br%10);
    br=br/10;
  }
  
  printf("%d\n",pom);
  return 0;
}
