아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Wipe it!

면접 대비

시간 제한2초메모리 제한1024 MB

요약
교사가 한 글자씩 쓸 때 현재 단어의 접미사가 앞쪽 다른 위치에 이미 나온 적이 있으면 그 접미사를 지운다. 최종 단어를 구한다.
난이도

보통10점 중 5점

유형
문자열, 해시맵, 구현
정답자
아직 제출이 없습니다

문제

In order to make his lessons more entertaining, one computer science teacher has invented a funny exercise.

During the exercise the teacher consequently writes out the letters of some word he had just thought of at the blackboard. Students' task is to shout <<Wipe it!>> every time the word written at the blackboard has some suffix which has already occurred at some other location in the word.

The moment the teacher hears the shout, he wipes off the suffix students has found and goes on writing out remaining letters.

Given the word the teacher has thought of and assuming students perfectly fulfil their task, find out the word that would be written on the blackboard in the end of the exercise.

입력

The input file contains a single line --- the word teacher thought of. It consists of lowercase English letters and it's length does not exceed 10001000 characters.

출력

Output a single line --- the word that would be written at the blackboard at the end of the exercise.

예제2

  1. 예제 1

    입력
    abcabc
    
    예상 출력
    abc
    
  2. 예제 2

    입력
    aaaaaaaa
    
    예상 출력
    a