프로그램 명: coci_tenis
제한시간: 1 초

[요약 중] After Borko's second plan of taking over the village fell through (because Mirko's brother Stanko drank all the water), young Zvonko decided to relax with sports. For this purpose he stocked up on carrot juice and peanuts, and dived onto the couch, ready to watch the next tennis match on television. 이런 목적으로 그는 당근 쥬스를 stock

While the two players are warming up, their statistics pop up on the screen. Zvonko noticed that the match history of the players contained invalid results. He had a brilliant idea where you write him a program that checks the validity of results, 그가 기막힌 생각을 가졌다. 당신은 그에게 프로그램을 which he will then sell to the record keepers and enjoy a leisurely life.

A tennis match consists of sets, each set consisting of games. The following rules apply: 테니스 시합이 set 로 이루어지고 각 세트가 게임으로 이루어지고 다음 룰은 적용된다.

A match result is valid if a match could have been played by the above rules and ended in the result. 경기가 위 룰에 의해서 치르지고 결고가 끝난다면 경기 결과는 유효하다. Additionally, if one of the players is Roger Federer (designated as "federer" in the input), then a result in which he has lost a set can't be valid (Zvonko knows Federer is from outer space).

Write a program that checks the validity of all matches between two players. 두 선수사이의 모든 시합의 유효성을 검증하는 프로그램을 작성하시오.


After Borko's second plan of taking over the village fell through (because Mirko's brother Stanko drank all the water), young Zvonko decided to relax with sports. For this purpose he stocked up on carrot juice and peanuts, and dived onto the couch, ready to watch the next tennis match on television.

While the two players are warming up, their statistics pop up on the screen. Zvonko noticed that the match history of the players contained invalid results. He had a brilliant idea where you write him a program that checks the validity of results, which he will then sell to the record keepers and enjoy a leisurely life.

A tennis match consists of sets, each set consisting of games. The following rules apply:

A match result is valid if a match could have been played by the above rules and ended in the result. Additionally, if one of the players is Roger Federer (designated as "federer" in the input), then a result in which he has lost a set can't be valid (Zvonko knows Federer is from outer space).

Write a program that checks the validity of all matches between two players.

입력

A set is given in the format "A:B", where A and B are games won by each player. These numbers will be integers between 0 and 99 (inclusive).

출력

For each match, in the order they're given in the input, output "da" if the result is valid, or "ne" if it isn't.

입출력 예

input 

sampras agassi 
6 
6:2 6:4 
3:6 7:5 2:6 
6:5 7:4 
7:6 7:6 
6:2 3:6 
6:2 1:6 6:8 

output 

da 
da 
ne 
da 
ne 
da 

input 

federer roddick 
1 
2:6 4:6 

output 

ne 
출처:coci/2006-2007/contest5 3

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]