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: Runtime Error

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

print('delicious' if B <= A else 'safe' if B <= A+X else 'dangerous')

Submission status: Runtime Error

Solution code:
n = int(input())
nlist = [int(input()) for i in range(n)]
c = 0
x = 1
while x != 2 and c < n:
    x = nlist[x - 1]
    c += 1
if x == 2:
    print(c)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
n = int(input())
nlist = [int(input()) for i in range(n)]
xlist = []
c = 0
x = 1
while x != 2 and x not in xlist:
    xlist.append(x)
    x = nlist[x - 1]
    c += 1
if x == 2:
    print(c)
else:
    print(-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,a,b=map(int,input().split());print(("delicious,"safe","dangerous")[(b-a>0)+(b-a>x)])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
n = []
for i in range(N):
  n.append(int(input()))

a = 1
c = -1

for i in range(N):
  a = n[a-1]
  if a == 2:
    c = (i+1)

print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
a = [0] + [int(input()) for _ in range(N)]
x = 1
visited = set([1])
answer = 0

while True:
  x = a[x]
  if x in visited:
    answer = -1
    break
  visited.add(x)
  answer += 1
  if x == 2:
    break
    
print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if a > b:
    print("delicious")
    exit()
if a < b and abs(a-b) <= x:
    print("safe")
if aa < b and abs(a-b) > x:
    print("dangerous")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#https://atcoder.jp/contests/abc065/tasks/abc065_a

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(input()) for i in range(N)]
count = 0
index = 1
end = 2
if not end in a:
    print(-1)
else :
    while(True):
        count += 1
        index = a[index-1]
        if (index == end):
            print(count)
            break
        elif count > N:
            print(-1)
            break

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(input()) for i in range(N)]
count = 0
index = 1
end = 2
if end in a:
    print(-1)
else :
    while(True):
        count += 1
        index = a[index-1]
        if (index == end):
            print(count)
            break
        elif count > N:
            print(-1)
            break

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())

a=[]
for i in range(n):
    a.append(int(input()))

cnt=0
ans=-1
x=1

for i in range(n):
    x=a[x-1]
    cnt+=1
    if x==2:
        ans=cnt
        break

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.size = [1] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

N=int(input())
X=[]
Y=[]
for i in range(N):
    x,y=map(int,input().split())
    X.append((x,i))
    Y.append((y,i))
X.sort()
Y.sort()
E=[]
ans=0
count=1
for i in range(N-1):
    a=X[i]
    b=X[i+1]
    c=Y[i]
    d=Y[i+1]
    E.extend([(b[0]-a[0],X[i][1],X[i+1][1]),(d[0]-c[0],Y[i][1],Y[i+1][1])])
E.sort()

U=UnionFind(N)
i=0
while(count<N):
    cost,v1,v2=E[i]
    if not U.same_check(v1,v2):
        U.union(v1,v2)
        ans+=cost
        count+=1
    i+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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: Runtime Error

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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]

cur = A[1]
for i in range(A[0]):
    if cur == 2:
        print(i + 1)
        break
    cur = A[cur]
else:
    print(-1)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
ixy = [[i] + list(map(int, input().split())) for i in range(n)]

ixy.sort(key=lambda x: x[1])

roads = []
for i in range(n - 1):
    i1, x1, y1 = ixy[i]
    i2, x2, y2 = ixy[i + 1]
    roads.append((x2 - x1, i1, i2))

ixy.sort(key=lambda x: x[2])
for i in range(n - 1):
    i1, x1, y1 = ixy[i]
    i2, x2, y2 = ixy[i + 1]
    roads.append((y2 - y1, i1, i2))

p = [i for i in range(n)]


def f_p(x):
    if x == p[x]:
        return x
    p[x] = f_p(p[x])
    return p[x]


roads.sort()
total_c = 0
for c, i1, i2 in roads:
    p1 = f_p(i1)
    p2 = f_p(i2)
    if p1 != p2:
        p[p1] = p2
        total_c += c

print(total_c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
aa = [int(input()) for _ in range(n)]

cur = 1
for i in range(n):
    cur = aa[cur-1]
    # print(cur)
    if cur == 2:
        print(i+1)
        break
else:
    print(-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,a,b=gets().chomp().split().map(&:to_i)

if a>=b
    puts("delicious")
elsif a+x>=b
    puts("safe")
else
    puts("dangerous")
end

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print "delicisous" if A - B >= 0  "safe" if X >= B - A else "dangerous"

Submission status: Runtime Error

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

if A > B:
    ans = 'delicious'
elif B - A <= X:
    ans = 'safe'
else:
    'dangerous'

print(ans)

Submission status: Runtime Error

Solution code:
import math

n,m = map(int,input().split())

x=0

s = []
for i in range(math.floor(math.sqrt(m)))
	if m%i==0:
		s.append(i)



for i in s
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<n;i++)
#define IREP(i,n) for(ll i=1;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define DEBUG(x) cerr << x << "\n"

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int x,a,b;
    cin >> x >> a >> b;
    
    // b-aが賞味期限から経った日数
    if (b-a <= 0) cout << "delicious\n";
    else if(b-a < x) cout << "safe\n";
    else cout << "dangerous\n";

    return 0;
}

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 20 21:40:30 2018
ABC065D
@author: maezawa
i=0...n (0-origin)
"""
import heapq

n = int(input())
a = []
b = []
for i in range(n): # i is a name of the city (0-origin)
    xy = list(map(int, input().split()))
    a.append([i,xy[0]])
    b.append([i,xy[1]])

a.sort(key=lambda x: x[1])
b.sort(key=lambda x: x[1])
#print(a) 
#print(b)

# making adj list
adj = [[] for _ in range(n)]
for i, [j, x] in enumerate(a[:-1]):
    adj[j].append([a[i+1][1]-x, a[i+1][0]])
    adj[a[i+1][0]].append([a[i+1][1]-x, j])
for i, [j, y] in enumerate(b[:-1]):
    adj[j].append([b[i+1][1]-y, b[i+1][0]])
    adj[b[i+1][0]].append([b[i+1][1]-y, j])

#print(adj)
    
# Prim's algorithm
d = [10**10]*n
visited = [False]*n
h = []
s = 0
heapq.heappush(h, [0, s])
cnt = 0
while h:
    cost, node = heapq.heappop(h)
    #if visited[node] != True and cost < d[node]:
    if visited[node] != True:        
        d[node] = cost
        visited[node] = True
        cnt += 1
        if cnt == n:
            break
        for edge in adj[node]:
            if visited[edge[1]] == True:
                continue
            heapq.heappush(h, edge)
            
#print(d)
print(sum(d))

Submission status: Runtime Error

Solution code:
nums = [1, 1]
def step_div(n):
	i = len(nums)
	while i <= n:
		nums.append(nums[i-1] * i)
		i += 1
	return nums[n]

n, m = map(int, input().split(" "))

remain = abs(n-m)
if remain <= 1:
	print((step_div(n) * step_div(m) * 2) % (10**9+7))
else:
	print(0)

Submission status: Runtime Error

Solution code:
tmp = input().split(" ")
if tmp[2]-tmp[1] <= 0:
  print("delicious")
elif tmp[2]-tmp[1]>tmp[0] :
  print("dangerous")
else :
  print("safe")

Submission status: Runtime Error

Solution code:
X,A,B=(int(i) for i in input().split())
c=int(B-A)
if c<0:
  print('delicious')
elif c<X+1:
  print('safe')
elif: c>X+1:
  print('dangerous')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = map(int,input().split())
b = a[1] - a[2]

if b > a[0]:
  print("dangerous")
elif b > 0:
  print("delicious")
else: 
  print("safe")

Submission status: Runtime Error

Solution code:
a = map(int,input().sprit())
b = a[1] - a[2]

if b > a[0]:
  print("dangerous")
elif b > 0:
  print("delicious")
else: 
  print("safe")

Submission status: Runtime Error

Solution code:
a = map(int,input(),sprit())
b = a[1] - a[2]

if b > a[0]:
  print("dangerous")
elif b > 0:
  print("delicious")
else: 
  print("safe")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=int(input())
a=int(input())
b=int(input())
if (a+x+1)<=b:
    print("dangerous")
elif ((a+x+1)>=b)and(b>a):
    print("safe")
else:
    print("delicious")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

okDay = int(sys.argv[1])
buyDay = int(sys.argv[2])
eatDay = int(sys.argv[3])
overDay = eatDay - buyDay
if overDay <= 0 :
    print("delicious")
    sys.exit()
if overDay <= okDay :
    print("safe")
    sys.exit()
print("dangerous")

Submission status: Runtime Error

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

Submission status: Runtime Error

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


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
if 2 not in a:
    print(-1)
else:
    cnt = 0
    before_num = 1
    lighted_bottons = []
    while True:
        cnt += 1
        if a[before_num - 1] == 2:
            print(cnt)
            break
        else:
            if a[before_num - 1] in lighted_bottons:
                print(-1)
                break
            before_num = a[before_num - 1]
            lighted_bottons.append(before_num)

Submission status: Runtime Error

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

if x+a-b > 1:
  print('delicious')
else if x+a-b == 0:
    print('safe')
else:
    print('dangerous')

Submission status: Runtime Error

Solution code:
x = input()
a = []
check = []
for i in range(int(x)):
    a.append(int(input()) - 1)
    check.append(1)

index = 0



while True:
    check[index] = 0
    index = a[index]
    if check[index] == 0:
        print(-1)
        break
    if index == 1:
        print(count)
        break

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(input()) for i in range(N)]
num = a[0]
ans = 0
check = 0
for n in range(1, N):
    num = a[num-1]
    if num-1 == 1:
        ans = n + 1
        check = 1
        break
if check != 1:
    print('-1')
else:
    print(ans)

Submission status: Runtime Error

Solution code:
first = input()
split_first = first.split()

d = int(split_first[0])
a = int(split_first[1])
b = int(split_first[2])

if a >= b:
   print ('delicious')
else if b - a <= d:
   print ('safe')
else:
   print ('dangerous')

Submission status: Runtime Error

Solution code:
l = map(int, raw_input().split())
print(l[0])
print(l[1])
print(l[2])
if (l[2] - l[1]) <= 0:
    print("delicious")
elif (l[2] - l[1]) <= l[0]:
    print("safe")
else:
    print("dangerous")

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))
if l[1]+l[2] < l[0]:
    print("delicious")
else:
    if l[2]-l[1] <= l[0]:
        print("safe")
    else:
        print("dangerous")
c

Submission status: Runtime Error

Solution code:
a=int(raw_input())
print a

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(raw_input())
a = []
for i in range(N):
	a.append(raw_input())
#print a
for i in range(N):
	a[i] = int(a[i])
cnt = 0
trn = 0
while trn != 1:
	if trn == -2:
		cnt = -1
		break
	#print a

	hako = trn
	trn = a[trn] - 1
	a[hako] = -1
	cnt += 1
	
print cnt

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
x = [False]*N
n,i = (0, 0)
while x[n] == False:
    x[n] = True
    n = a[n]-1
    i+=1
    if n==1:
        print(i)
        break
else:
    print(-1)

Submission status: Runtime Error

Solution code:
if (B-A)>X:
	return ‘dangerous’
elif (B-A)<0:
	return ‘delicious’
else:
	return ‘safe’

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]

count = 0
nextbottun = 1

while(nextbottun != 2 and count <= 100000):
    nextbottun = a[nextbottun - 1]
    count += 1

if count <= 100000:
    print(count)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
num=raw_input('the 3 number of days:')
numberdays=num.split(' ')
if int(numberdays[2])-int(numberdays[1])>int(numberdays[0]):
    print 'dangerous'
if 0<int(numberdays[2])-int(numberdays[1])<=int(numberdays[0]):
    print 'safe'
if if int(numberdays[2])-int(numberdays[1])<=0:
    print 'delicious'

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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