Problem:


Score : 100 points

Problem Statement

Takahashi has a strong stomach. He never gets a stomachache from eating something whose "best-by" date is at most X days earlier.
He gets a stomachache if the "best-by" date of the food is X+1 or more days earlier, though.

Other than that, he finds the food delicious if he eats it not later than the "best-by" date. Otherwise, he does not find it delicious.

Takahashi bought some food A days before the "best-by" date, and ate it B days after he bought it.

Write a program that outputs delicious if he found it delicious, safe if he did not found it delicious but did not get a stomachache either, and dangerous if he got a stomachache.

Constraints

1 ≤ X,A,B ≤ 10^9

Input

Input is given from Standard Input in the following format:

X A B

Output

Print delicious if Takahashi found the food delicious; print safe if he neither found it delicious nor got a stomachache; print dangerous if he got a stomachache.

Sample Input 1

4 3 6

Sample Output 1

safe

He ate the food three days after the "best-by" date. It was not delicious or harmful for him.

Sample Input 2

6 5 1

Sample Output 2

delicious

He ate the food by the "best-by" date. It was delicious for him.

Sample Input 3

3 7 12

Sample Output 3

dangerous

He ate the food five days after the "best-by" date. It was harmful for him.



Sample input:
4 3 6


Sample output:
safe

Submission status: Wrong Answer

Solution code:
x,a,b = map(int, input().split())
r = (-a) + b
if r < 0:
    print("delicious")
elif r < x + 1:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:

x,a,b = map(int, input().split())
r = -a + b + 1
if r < x:
    print("delicious")
elif r==x:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
x , a, b = map(int, input().split())
if a >= b:
    print("delicious")
elif b - a >= x:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if(b>c):
  print("delicious")
elif((a+b)>c):
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if(b<c):
  print("delicious")
elif((a+b)<c):
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())
if B<=A:
  print("safe")
elif B<=A+X:
  print("delicious")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())
if B>(X+A):
  print("dangerous")
elif B<A:
  print("delicious")
else:
  print("safe")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int, input().split())
if b<=a:
    print("delicious")
elif b<a+x:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int, input().split())
if (b-a) < 0:
  print("delicious")
elif (b-a) > x:
  print("dangerous")
else:
  print("safe")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
if a>b:
    print("delicious")
elif (b-a)<x:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int, input().split())
print("dangerous" if b-a>x else "safe" if b>a else "dalicious")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int, input().split())
print("dangerous" if b-a>x else "safe" if b<a else "dalicious")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int, input().split())
print("dalicious" if a-b > 0 else "safe" if b-a<=x else "dangerous")

Submission status: Wrong Answer

Solution code:
#ABC065A
X, A, B = map(int, input().split())
if A-B > 0:
    print("delicious")
elif B-A < X+1:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
#ABC065A
X, A, B = map(int, input().split())
if A-B > 0:
    print("delicious")
if B-A < X+1:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

if b > c:
    print('delicious')
elif a >= (b-a):
    print('safe')

else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

if b >= c:
    print('delicious')
elif a >= (b-a):
    print('safe')

else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
if a[2]-a[1] < 0:
	print('delicious')
elif a[2]-a[1] < a[0]:
	print('safe')
else:
	print('dangerous')

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())

if A <= X:
    print('delicious')
elif X <= B - A:
    print('dangerous')
else:
    print("safe")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a >= b+c:
  print("delicious")
elif a+b < c:
  print("dangerous")
elif a < b+c and a+b >= c:
  print("safe")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if B-A > X+1:
    print('dangerous ')
elif B-A <= X+1 and A < B:
    print('safe')
else:
    print('delicious ')

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if b<a:
  print("delicious")
elif b<a+x:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())
if(a - b > 0):
	print("delicious")
elif(abs(a - b) <= x):
	print("safe")
else:
	print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())
if(a - b < 0):
	print("delicious")
elif(abs(a - b) <= x):
	print("safe")
else:
	print("dangerous")

Submission status: Wrong Answer

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x,a,b = f()

    after_by = a - b

    if a-b<=0:
        print('delicious')
    elif b-a<=after_by:
        print('safe')
    else:
        print('dangerous')

solve()

Submission status: Wrong Answer

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x,a,b = f()

    after_by = b - a

    if b-a<=0:
        print('delicious')
    elif b-a<=after_by:
        print('safe')
    else:
        print('dangerous')

solve()

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
print(["delicious" if -A+B<0 else "safe","dangerous"][X<-A+B])

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
print(["delicious" if -A+B<0 else "safe","dangerous"][X<=-A+B])

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A >= B:
    print("delicous")
elif B - A <= X:
    print("safe")
else:
    print("dagerous")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A >= B:
    print("delicous")
elif (B - A) > X:
    print("dagerous")
else:
    print("safe")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A >= B:
    print("delicous")
elif (A - B) <= X:
    print("safe")
else:
    print("dagerous")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A > B:
    print("delicous")
elif abs(B - A) > X:
    print("safe")
else:
    print("dagerous")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A - B > 0:
    print("delicous")
elif abs(B - A) <= X:
    print("safe")
elif abs(B - A) > X:
    print("dagerous")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A - B > 0:
    print("delicous")
elif B - A <= X:
    print("safe")
else:
    print("dagerous")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A >= B:
    print("delicious")
elif abs(A - B) > X:
    print("dagerous")
elif abs(A - B) <= X:
    print("safe")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A >= B:
    print("delicious")
elif abs(A - B) >= X:
    print("dagerous")
else:
    print("safe")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A >= B:
    print("delicious")
elif abs(A - B) > X:
    print("dagerous")
else:
    print("safe")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A >= B:
    print("delicious")
elif (A - B) > X:
    print("dagerous")
else:
    print("safe")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A <= B:
    print("delicious")
elif (A - B) > X:
    print("dagerous")
else:
    print("safe")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())
if B-A<0:
  print('delicious')
elif B-A<=X:
  print('safe')
else:
  print('dangerous')

Submission status: Wrong Answer

Solution code:
a, b, c = (int(i) for i in input().split())  

if a + b < c:
  print("dangerous")
elif b <= c:
  print("safe")
else:
  print("delicious")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

x, a, b = map(int, input().split())

print('dangerous' if x + a - b < 0 else 'delicious')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

x, a, b = map(int, input().split())

print('dangerous' if x - a - b < 0 else 'delicious')

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if a-b>=0:
  print("delicious")
else:
  if abs(a-b) > x+1:
    print("dangerous")
  else:
    print("safe")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if a-b>0:
  print("delicious")
else:
  if abs(a-b) > x+1:
    print("dangerous")
  else:
    print("safe")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
if a-b>=0:
  print('delicious')
elif a+x-b>=0:
  print('safe')
else:
  print('dengerous')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print("delicious" if b>c else "safe" if (c-b)<=a else "dangerous")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print("delicious" if (c-b)<=a else "dangerous")

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())
if B - A < 0:
    print("delicious")
elif B - A <= X:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    X,A,B = (int(_) for _ in input().split())
    if (B-A) < X:        
        if B <= A:
            print('delicious')
        else:
            print('safe')
    else:
        print('dangerous')
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    X,A,B = (int(_) for _ in input().split())
    if (B-A) <= X:        
        if B < A:
            print('delicious')
        else:
            print('safe')
    else:
        print('dangerous')
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    X,A,B = (int(_) for _ in input().split())
    if (B-A) <= X:        
        if B < A:
            print('delcious')
        else:
            print('safe')
    else:
        print('dangerous')
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    X,A,B = (int(_) for _ in input().split())
    if B < A:
        print('delious')
    elif (B-A) <= X:
        print('safe')
    else:
        print('dangerous')
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    X,A,B = (int(_) for _ in input().split())
    if B < A:
        print('delious')
    elif (B-A) < X:
        print('safe')
    else:
        print('dangerous')
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if a>b:print("delicious")
elif a+x>=b:print("safe")
else:print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if a>b:print("delicious")
elif a+x>b:print("safe")
else:print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if b>a and b-a<x:
	print("safe")
elif b<a and a-b<x:
	print("delicious")
else:
	print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if b>a and b-a<x:
	print("safe")
elif b==a and b-a==x:
	print("delicious")
elif b<a and a-b<x:
	print("delicious")
else:
	print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if b>a and b-a<x:
	print("safe")
elif b<=a and a-b<=x:
	print("delicious")
else:
	print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if 0<b-a<x:
	print("safe")
elif 0<a-b<=x:
	print("delicious")
else:
	print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if a>b:
  print('delicious')
elif (b-a)<=x:
  print('safe')
else:
  print('dangerous')

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if a>b:
  print('delicious')
elif (b-a)<x:
  print('safe')
else:
  print('dangerous')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A - B <= 0:
  print("delicious")
elif X + A - B <=0:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if B - A <= 0:
  print("delicious")
elif X - B + A <=0:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b=map(int,input().split())
if b>=a:
    print('delicious')
elif a-b<=x:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())
ans = 'delicious' if a - b >= 0 else 'safe' if (b - a) < x else 'dangerous'
print(ans)

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if B <= A:
    print('delicius')
elif B <= A+X:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if B < A:
    print('delicius')
elif B < A+X:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if 0 > B-A:
    print('delicious')
elif X >= B-A:
    print('safe')
if X < B-A:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if 0 > B-A:
    print('delicious')
elif X >= B-A:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if 0 > B-A:
    print('delicious')
elif X > B-A:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
if(A>B):
        print('delicious')
elif(B-A)<X:
        print('safe')
else:
        print('dangerous')

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
if(A>=B):
        print('delicious')
elif(B-A)<X:
        print('safe')
else:
        print('dangerous')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
x,a,b = map(int,input().split())

c = b - a

if c <= 0:
    print("delicious")
elif c < x:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())

if b > a+x:
  print("dangerou")
elif b > a:
  print("safe")
else:
  print("delicious")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
bought = a
best_buy = a + x
ate = a + b

if ate <= best_buy :
    print("delicious")
elif ate - best_buy < x :
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
bought = a
best_buy = a + x
ate = a + b

if ate <= best_buy :
    print("delicious")
elif ate - best_buy <= x :
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
x,a,b = LI()
if b<a:
    print("delicious")
elif b-a <= x:
    print("safe")
else:
    print("dangerous")
#B

#C

#D
"""
def root(x):
    if x == par[x]:
        return x
    par[x] = root(par[x])
    return par[x]

def same(x,y):
    return root(x) == root(y)

def unite(x,y):
    x = root(x)
    y = root(y)
    if rank[x] < rank[y]:
        par[x] = y
    else:
        par[y] = x
        if rank[x] == rank[y]:
            rank[x] += 1
n = I()
v = LIR(n)
l = [None for i in range(2*n-2)]
for i in range(n):
    v[i].append(i)
par = [i for i in range(n)]
rank = [0 for i in range(n)]
v.sort(key = lambda x:x[0])
for i in range(n-1):
    l[i] = [v[i][2],v[i+1][2],v[i+1][0]-v[i][0]]
v.sort(key = lambda x:x[1])
for i in range(n-1):
    l[i+n-1] = [v[i][2],v[i+1][2],v[i+1][1]-v[i][1]]
l.sort(key = lambda x:x[2])
k = 0
ans = 0
for i in range(2*n-2):
    x,y,c = l[i]
    if not same(x,y):
        k += 1
        ans += c
        unite(x,y)
    if k == n-1:break
print(ans)
"""
#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())
onaka = ""
if A >= B:
    onaka = 'delicious'
else:
    if B - A <= X:
        onaka = 'safe'
    elif B - A > X:
        onaka = 'dengerous'
print(onaka)

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())
onaka = ""
if A > B:
    onaka = 'delicious'
elif A <= B:
    if B - A <= X:
        onaka = 'safe'
    else:
        onaka = 'dengerous'
print(onaka)

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())
onaka = ""
if A >= B:
    onaka = 'delicious'
elif A < B:
    if B - A <= X:
        onaka = 'safe'
    elif B - A >= X:
        onaka = 'dengerous'
print(onaka)

Submission status: Wrong Answer

Solution code:
X,A,B = map(int, input().split())
print('delicious' if A - B >= 0 else 'safe' if abs(A - B) < X else 'dangerous')

Submission status: Wrong Answer

Solution code:
X,A,B = map(int, input().split())
print('delicious' if A - B > 0 else 'safe' if abs(A - B) < X else 'dangerous')

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())
if a - b > 0:
    print('delicious')
elif a - b + x < 0:
    print('dangerous')
else:
    print('safe')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if B - A > X:
    print('safe')
elif B - A >= 0 and B - A <= X:
    print('delicious')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if B - A >= X:
    print('safe')
elif B - A >= 0 and B - A < X:
    print('delicious')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if B - A >= X:
    print('delicious')
elif B - A >= 0 and B - A < X:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if B - A > X:
    print('delicious')
elif B - A <= X:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
X,A,B = map(int, input().split())

if A + X < B:
    print("dengerous")
if A <= B <= A + X:
    print("safe")
if B < A:
    print("delicious")

Submission status: Wrong Answer

Solution code:
X,A,B = map(int, input().split())

if A + X < B:
    print("dengerous")
if A < B <= A + X:
    print("safe")
if B <= A:
    print("delicious")

Submission status: Wrong Answer

Solution code:
X , A, B = map(int, input().split())

delicious = True
dangerous = True
if B >= A:
    delicious = False
if B >= A + X:
    dangerous = False
    
if delicious:
    print('delicious')
elif dangerous:
    print('safe')
else:
    print("dengerous")

Submission status: Wrong Answer

Solution code:
X , A, B = map(int, input().split())

delicious = True
dangerous = True
if B > A:
    delicious = False
if B > A + X:
    dangerous = False
    
if delicious:
    print('delicious')
elif dangerous:
    print('safe')
else:
    print("dengerous")

Submission status: Wrong Answer

Solution code:
X, A, B = [int(_) for _ in input().split()]
print("delicious" if B < A else "safe" if B - A < X else "dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())
if a > b:
    print("delicious")
elif x + a > b:
    print("safe")
else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())
y = b - a
if y < 0:
  print('delicious')
elif x < y:
  print('dangerous')
else:
  print('safe')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a<c-b:print("dangerous")
elif b>c:print("delicious")
else:print("safe")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a<c-b:print("dangerous")
elif b>c:("delicious")
else:print("safe")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
if a >= b:
    print('delicious')
elif b-a <= x:
    print('safe')
else:
    print('dengerous')

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
if a >= b:
    print('delicious')
elif b-a < x:
    print('safe')
elif b-a >= x:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
if a >= b:
    print('delicious')
elif b-a < x:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
#ABC65
x, a, b = map(int, input().split())
if(b>a+x):
    print("dangerous")
elif(b<a):
    print("delicious")
else:
    print("safe")

Submission status: Wrong Answer

Solution code:
x,a,b = (int(i) for i in input().split())

if b-a <= 0:
    print("delicious")
elif b-a > x:
    print("safe")
else:
    print("delicious")

Submission status: Wrong Answer

Solution code:
x,a,b = (int(i) for i in input().split())

if b-a > x:
    print("dangerous")
else:
    print("delicious")

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())
if A-B>=0:
	print("delicious")
elif abs(A-B)<X:
	print("safe")
else:
	print("dangerous")

Submission status: Wrong Answer

Solution code:
X, A, B = map(int, input().split())

if A>=B:
  print('delicious')
elif B-A>=X:
  print('safe')
else:
  print('dangerous')

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())

if a <= b:
  print("delicious")
elif a > b and a+x >= b:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())

if a > b:
  print("delicious")
elif a <= b and a+x >= b:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())

if a < b:
  print("delicious")
elif a >= b and a+x <= b:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())

if a < b:
  print("delicious")
elif a >= b and a+x >= b:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())

if b-a < 0:
  print("delicious")
elif b-a >= 0 and b-a <= x:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, input().split())

if b-a < 0:
  print("delicious")
elif b-a >= 0 and b-a >= x:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
if B-A <= X and B-A > 0:
    print("safe")
elif B-A < 0:
    print("delicious")
elif B-A > X:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
if B-A <= X and B-A > 0:
    print("safe")
elif B-A < 0:
    print("delicious")
elif B-A > X+1:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
X,A,B = map(int,input().split())
if B-A<=0:
  print("delicious")
elif B-A<X:
  print("safe")
else:
  print("dangerous")

Submission status: Wrong Answer

Solution code:
x,a,b = map(int, input().split())
if b-a > x:
  print("dangerous")
else:
  print("delicious")

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
if (B-A)<0:
  print("delicious")
else:
  if(B-A)<X:
    print("safe")
  else:
    print("dangerous")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int,input().split())
if a - b > 0:
  print("delicious")
elif b - a >= x:
  print("dangerous")
else:
  print("safe")

Submission status: Wrong Answer

Solution code:
x, a, b = map(int,input().split())
if a - b > 0:
  print("delicious")
elif b - a > x:
  print("dangerous")
else:
  print("safe")

Submission status: Wrong Answer

Solution code:
from sys import stdin
x, a, b = [int(x) for x in stdin.readline().rstrip().split()]
if a > b:
  print('delicious')
elif a <= b:
  if abs(a-b) > x+1:
    print('dangerous')
  else:
    print('safe')

Submission status: Wrong Answer

Solution code:
from sys import stdin
x, a, b = [int(x) for x in stdin.readline().rstrip().split()]
if a > b:
  print('delicious')
elif a <= b:
  if a-b > x+1:
    print('dangerous')
  else:
    print('safe')

Submission status: Wrong Answer

Solution code:
from sys import stdin
x, a, b = [int(x) for x in stdin.readline().rstrip().split()]
if a > b:
  print('delicious')
elif a <= b:
  if a-b+x < 0:
    print('dangerous')
  else:
    print('safe')

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
if B-A>X:
    print('dangerous')
elif (B-A)<=X:
    print('safe')
else:
    print('delicious')

Submission status: Wrong Answer

Solution code:
X,A,B=map(int,input().split())
if B-A>X:
    print('dangerous')
elif (B-A)==X:
    print('safe')
else:
    print('delicious')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
X, A, B = map(int, input().split())
if B - A > X:
  print('dangerous')
elif B - A < 0:
  print('delicious')
else:
  print('safe')

Submission status: Wrong Answer

Solution code:
x,a,b=[int(i) for i in input().split()]
if a-b>=0:
    print("delicious")
elif x>=b-a:
    print("safe")
else:
    print("denderous")

Submission status: Wrong Answer

Solution code:
# ABC 064 A - Expired?
x,a,b =map(int,input().split())
if a - b >= 0:
    print("delicious")
elif b- a < x:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
# ABC 064 A - Expired?
x,a,b =map(int,input().split())
if a - b > 0:
    print("delicious")
elif b- a <= x:
    print('safe')
else:
    print('dangerous')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print('delicious' if c<b else 'safe' if c-b>=a else 'dangerous')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print('delicious' if c<b else 'safe' if c-b<=a else 'dangerous')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print('delicious' if c<b else 'safe' if c-b<=a else 'dengerous')