Bad English

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

요약
녹음 문장과 네덜란드어 원본, 네덜란드어에서 영어로의 단어 대응표가 주어질 때 녹음이 단어별 직역인지 판정한다.
난이도

보통10점 중 4점

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

문제

The Dutch are known to be bad at English sometimes, especially when it comes to pronunciations and translations. A classic example is the football manager Louis van Gaal. During a press conference he said "That is another cook.", which is a literal translation of the dutch figure of speech "Dat is andere koek.". These so called "stonecoal English" sentences are sentences that are literally translated from Dutch to English.

Since you are responsible for the next broadcast of van Gaal, you wish to prevent the occurrence of these "stonecoal English" sentences. Luckily, this broadcast is not live and hence when you detect a faulty sentence, you can simply redo that part. During the recording a program automatically records all sentences van Gaal says. Your task is to write a program that, given a dictionary of words, the output of the recording by the program and the Dutch equivalent of the recording, checks if sentences are said in "stonecoal English". As said before, a "stonecoal English" sentence is a sentence that is literally translated. If different, additional or fewer words are used or if the sentence contains words that are spelled incorrectly, then we may assume that an attempt was made by van Gaal to speak correct English and thus we won't mark them as "stonecoal English". You do not have to take (correct) punctuation into account.

입력

Four strings rr, tt, dd and ee which contain between 1 and 10410^4 (inclusive) words separated by spaces. The first string rr is the recording of van Gaal. The second string tt is the Dutch equivalent of what van Gaal meant. The third string dd lists the Dutch words said in tt without repetition, in lowercase and are sorted alphabetically. The fourth string ee contains the English translation of the words in dd in the same order as they occur in dd (this means that ee and dd contain an equal amount of words), again in lowercase.

출력

Output "STONECOAL" if the sentence was literally translated and hence belong to the domain of "stonecoal English". Output "VALID" otherwise.

예제3

  1. 예제 1

    입력
    Make that the cat wise.
    Maak dat de kat wijs.
    dat de kat maak wijs
    that the cat make wise
    
    예상 출력
    STONECOAL
    
  2. 예제 2

    입력
    He kicked the ball very hard.
    Hij schopte hard tegen de bal.
    bal de hard hij schopte tegen
    ball the hard he kicked against
    
    예상 출력
    VALID
    
  3. 예제 3

    입력
    That hits like a tang on a pig.
    Dat slaat als een tang op een varken.
    als dat een op slaat tang varken
    if that a on hit pliers pig
    
    예상 출력
    VALID