jiahuimbzuai/CoQuIR huggingface dataset:
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
    int N = 0;
    float sum;
    float amount[10];
    char kind[10][3];
    scanf("%d", &N);

    for(int i=0; i<N; i++) {
        scanf("%f %s", &amount[i], kind[i]);
        if(strcmp(kind[i], "JPY") == 0) {
            sum += amount[i];
        } else if(strcmp(kind[i], "BTC") == 0) {
            sum += amount[i]*380000.0;
        } else {
            continue;
        }
    }
    printf("%f\n", sum);
}
//  [c]
#include<stdio.h>
int main(void)
{
  int n, i=0;
  scanf("%d", &n);
  double a, b, ans;
  ans = 0;
  char s[4];
  do{
    scanf("%lf %s", &a, s);
    if(s[0]=='B'){
      a *= 380000.0;
    }
    ans += a;
    a = 0;
    i++;
  }while(i<n);
  printf("%lf\n", ans);
}
//  [c]
#include <stdio.h>
#include <string.h>

#define BIT 380000.0

int main(void) {
    int N,i;
    scanf("%d", &N);
    double x, ans = 0.0; char s[4];
    for(i = 0; i < N; ++i){
        scanf("%lf %s", &x, s);
        if(strcmp(s, "JPY") == 0) {
            ans += x;
        } else if(strcmp(s, "BTC") == 0) {
            ans += BIT*x;
        }
    }
    printf("%lf\n", ans);
    return 0;
}
//  [c]
#include <stdio.h>

int main(void){
  int N;
  long double x, sum = 0.0;
  char u[3]; 
  scanf("%d", &N);
  
  for(int i = 0; i < N; i++){
    scanf("%Lf" "%s", &x, u);
    if(u[0] == 'B'){
      sum += x * 380000.0;
    }else {
      sum += x;
    }
  }
  printf("%Lf\n", sum);
  return 0;;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    int n;
    double x[max], ans=0;
    char u[max][4];
    
    scanf("%d", &n);
    rep(i, n){
        scanf("%lf%s", &x[i], u[i]);
    }
    
    rep(i, n){
        if (!strcmp(u[i], "JPY")) {
            ans+=x[i];
        } else if (!strcmp(u[i], "BTC")) {
            ans+=x[i]*380000;
        }
    }
    
    printf("%lf", ans);
    
    return 0;
}
//  [c]
#include <stdio.h>

int main()
{
	int i, N;
	long double x, sum = 0.0;
	char u[4];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		scanf("%Lf %s", &x, u);
		if (u[0] == 'B') sum += x * 380000.0;
		else sum += x;
	}
	printf("%Lf\n", sum);
	fflush(stdout);
	return 0;
}
//  [javascript]
"use strict"

function Main(stdin){
stdin = stdin.trim().split("\n").reverse();
var stdout = [];
function input(){return stdin.pop()};
function print(x){stdout.push(x)};
function mapint(x){return x.map(n=>parseInt(n))};
function max(x){return x.reduce(function(a,b){ return Math.max(a,b) }) }
function min(x){return x.reduce(function(a,b){ return Math.min(a,b) }) }
function sum(x){return x.reduce(function(a,b){ return a+b }) }
function all(x){return x.reduce(function(a,b){ return a && b }) }
function any(x){return x.reduce(function(a,b){ return a || b }) }



var n = parseInt(input())
var s = 0.0
for (var i = 0; i < n; i++){
    var tmp = input().split(" ")
    var xi = parseFloat(tmp[0])
    var vi = tmp[1]
    if (vi == "BTC"){
        s += xi * 380000.0
    }else{
        s += xi
    } 
}
print(s)




stdout = stdout.join("\n");
console.log(stdout);
return stdout
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))
//  [javascript]
const fs = require('fs');

const main = (input) => {
  const tail = input.slice(1).map(x => x.split(' '));

  const money = tail.map(x => conv(Number(x[0]), x[1])).reduce((acc, x) => acc + x, 0);

  console.log(money);
};

const conv = (n, type) => {
  if (type === 'JPY') {
    return n;
  } else if (type === 'BTC') {
    return n * 380000.0;
  }
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n'));
//  [javascript]
const fs = require('fs');

const main = (input) => {
  const tail = input.slice(1);

  const money = tail
    .map(x => x.split(' '))
    .map(arr => conv(Number(arr[0]), arr[1]))
    .reduce((acc, x) => acc + x, 0);

  console.log(money);
};

const conv = (n, type) => {
  if (type === 'JPY') {
    return n;
  } else if (type === 'BTC') {
    return n * 380000.0;
  }
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n'));
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var n = o.a();
  var ans = 0;
  for(var i = 0; i < n; i++){
    var x = o.a(1);
    var y = o.a(1);
    if(y === "JPY")ans += +x;
    else ans += +x * 380000;
  }
  return ans;
}
//  [javascript]
"use strict";
function Main(input) {
    let lines = input.split("\n");
    let N = lines[0] - 0;
    let sum = 0;
    for (let n = 1; n <= N; n++) {
        let xv = lines[n].split(/\s/);
        let x = xv[0] - 0;
        sum += (xv[1] == 'BTC') ? x * 380000.0 : x;
    }

    console.log(sum);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var n=r(1);r(2)(n.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";var n=r(3),i=r(5);t.exports=function(t){var e=new n(t);i(e)}},function(t,e,r){"use strict";var n=r(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new n(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,r){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,r){"use strict";t.exports=function(t){for(var e=t.in(),r=0,n=0;n<e;n++){var i=Number(t.inr());r+="JPY"==t.inr()?i:38e4*i}console.log(r)}}]);
//  [go]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	var (
		x, ans float64
		u      string
	)
	for i := 0; i < n; i++ {
		fmt.Scan(&x, &u)
		if u == "JPY" {
			ans += x
		} else {
			ans += 380000 * x
		}
	}

	fmt.Println(ans)
}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var n int 
  fmt.Scan(&n)
  tot := 0.0
  for i := 0; i < n; i++ {
    var x float64
    var u string
    fmt.Scan(&x, &u)
    if u == "BTC" {
      x *= 3.8e+5
    }
    tot += x
  }
  fmt.Println(tot)
}
//  [go]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	var (
		x, ans float64
		u      string
	)
	for i := 0; i < n; i++ {
		fmt.Scan(&x, &u)
		if u == "BTC" {
			x = 380000 * x
		}
		ans += x
	}

	fmt.Println(ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	n := iScan()
	ans := 0.
	for i := 0; i < n; i++ {
		x := fScan()
		if Scan() == "JPY" {
			ans += x
		} else {
			ans += x * 380000.
		}
	}
	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	var sum float64
	for i := 0; i < n; i++ {
		var currency string
		var amount float64
		fmt.Scan(&amount, &currency)
		if currency == "BTC" {
			sum += 380000.0 * amount
		} else {
			sum += amount
		}
	}
	fmt.Println(sum)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var ans float32
	for i := 0; i < n; i++ {
		var x float32
		var u string
		fmt.Scan(&x)
		fmt.Scan(&u)
		if u == "BTC" {
			x *= 380000
		}
		ans += x
	}
	fmt.Println(ans)
}
//  [ruby]
# abc119 B
n = gets.to_i
r = 0
p n.times.map {
  xx, yy = gets.split
  x = xx.to_f
  y = yy.chomp
  case y
  when 'JPY' then x
  when 'BTC' then x * 380000
  end
}.inject(:+)
//  [ruby]
n = gets.to_i
res = 0.0
n.times do |_|
  x, u = gets.chomp.split
  case u
  when "JPY"
    res += x.to_f
  when "BTC"
    res += 380000.0  * x.to_f
  end
end
puts "%.6f" % res
//  [ruby]
n = gets.to_i
sum = 0
n.times do
  x, u = gets.split
  sum += if u == 'JPY'
           x.to_f
         else
           380_000.0 * x.to_f
         end
end
puts sum
//  [ruby]
n = gets.to_i
yen = 0
bit = 0
n.times do
  x1,u1 = gets.strip.split
  x = x1.to_f
  u = u1.to_s
  if u == "JPY"
    yen += x
  else
    bit += x
  end
end
puts yen+bit*380000
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end
require 'bigdecimal'

N = get_int

sum = BigDecimal(0)

N.times do |i|
  x, u = gets.chomp.split
  num = BigDecimal(x)
  if u == 'JPY'
    sum += num
  else
    sum += num * BigDecimal(380000)
  end
end

puts sum.to_f
//  [ruby]
N = gets.to_i
puts readlines.sum {|s| s.split.then {|x,y| (y == "JPY") ? x.to_i : x.to_f * 380000 } }
//  [rust]
#![allow(unused)]

//入力マクロここから
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
//入力マクロここまで

fn main() {
    input! {
        n: usize,
        xus: [(f64,String);n],
    }

    let ans: f64 = xus
        .iter()
        .map(|x| if x.1 == "JPY" { x.0 } else { x.0 * 380000.0 })
        .sum();
    println!("{}", ans);
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        aa: [(f64, String); n]
    }
    let mut sum: f64 = 0.0;
    for (x,u) in aa {
        sum += match &u[..] {
            "JPY" => x,
            "BTC" => x * 380000.0,
            _     => panic!()
        };
    }
    println!("{}", sum);
}
//  [rust]
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let n = v[0];
	let mut x:f64 = 0.00000;
	for i in 0..n {
		let mut buf = String::new();
		io::stdin().read_line(&mut buf).expect("");
		let v:Vec<&str> = buf.split_whitespace().collect();
		if v[1] == "JPY" {
			x += v[0].parse::<f64>().ok().unwrap();
		}else{
			x += 380000.0*v[0].parse::<f64>().ok().unwrap();
		}
	}
	println!("{}", x);
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize
    };

    let mut sum = 0.0;
    for _ in 0..n {
        input! {
            x: f64,
            u: String,
        }

        if u == "JPY" {
            sum += x;
        } else {
            sum += x * 380000.0;
        }
    }

    println!("{}", sum);
}
//  [rust]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use text_io::*;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let n: usize = read!();
    let mut ans = 0.0;
    for _ in 0..n {
        let x: f64 = read!();
        let u: String = read!();
        let mut num = 0.0;
        match &u[..] {
            "JPY" => num += x,
            "BTC" => num += x * 380000.0,
            _ => panic!("What the hell?"),
        }
        
        ans+=num;
    }
    
    println!("{}", ans);
}
//  [rust]
use proconio::input;

fn main() {
    input!(xu: [(f64, String)]);
    let ans: f64 = xu
        .iter()
        .map(|(x, u)| if u == "JPY" { *x } else { x * 380000.0 })
        .sum();
    println!("{}", ans)
}
//  [swift]
import Foundation

let N = Int(readLine()!)!

var money = 0.0
for _ in 0..<N {
    let input = readLine()!.componentsSeparatedByString(" ")
    if input[1] == "JPY" {
        money += Double(input[0])!
    } else {
        money += Double(input[0])! * 380000.0
    }
}

print(money)
//  [typescript]
const main = (input: string) => {
  const lines = input.split("\n");
  const RATE = 380000;
  let answer = 0;
  lines.slice(1).map(line => {
    if(line.slice(-3) === "JPY") {
      answer += Number(line.slice(0, -4));
    } else {
      answer += Number(line.slice(0, -4)) * RATE;
    }
  })
  console.log(answer);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
((input: string): void => {
    const hoge = input.trim().slice(1).split(/\n/).map(
        (i) => { return i.split(" ") }
    );
    let piyo: number = 0;
    for(let i of hoge) {
        piyo += (i[1] == 'JPY') ? Number(i[0]) : Number(i[0]) * 380000;
    }
    console.log(piyo);
})(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc119 {

    export class Program {
        /**
         * in
         2
         10000 JPY
         0.10000000 BTC

         * out
         48000.0
         */
        static main(inp: string): void {
            const n: number = parseInt(inp.split('\n')[0], 10);
            let ans: number = 0;

            for (let i: number = 1; i < n + 1; i++) {
                const x: number = parseFloat(inp.split('\n')[i].split(' ')[0]);
                const y: string = inp.split('\n')[i].split(' ')[1];

                if (y === 'JPY') {
                    ans += x;
                }
                if (y === 'BTC') {
                    ans += x * 380000.0;
                }
            }

            console.log(ans);
        }
    }
}

AtCoder.abc119.Program.main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [typescript]
namespace Coder {
  class Scanner {
    private buffer: string = '';
    private stdinQueue: any = [];

    constructor() {
      process.stdin.resume();
      process.stdin.setEncoding('utf8');
      process.stdin.on(
        'data',
        (chunk): void => {
          this.buffer += chunk;
          while (this.stdinQueue.length > 0) {
            const i = this.buffer.indexOf('\n');
            if (i < 0) {
              break;
            }
            let line = this.buffer.substr(0, i);
            if (line.endsWith('\r')) {
              line = line.slice(0, -1);
            }
            this.buffer = this.buffer.substr(i + 1);
            this.stdinQueue.shift()(line);
          }
        },
      );
    }
    public getLine(): Promise<string> {
      return new Promise((resolve, reject) => {
        const i = this.buffer.indexOf('\n');
        if (i >= 0 && this.stdinQueue.length == 0) {
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          resolve(line);
        } else {
          this.stdinQueue.push(resolve);
        }
      });
    }

    public close(): void {
      process.stdin.pause();
    }
  }

  async function slove() {
    const sc = new Scanner();
    const N = +(await sc.getLine());
    const ratio = 380000;
    let ans = 0;
    for (let i = 0; i < N; i++) {
      const [x, u] = (await sc.getLine()).split(' ');
      if (u === 'JPY') {
        ans += Number(x);
      } else {
        ans += Number(x) * ratio;
      }
    }
    console.log(ans);
    sc.close();
  }

  slove();
}
//  [typescript]
// const input = require('fs').readFileSync('/dev/stdin', 'utf8');
// const inputList = input.split('/'); // 空白文字に注意
// const inputNumberList = inputList.map(Number);

const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const inputList = input.split('\n');
// const inputNumberList = inputList.map(Number);

const N = inputList[0];
const xu= inputList.slice(1, -1);

let total = 0;

xu.forEach((i) => {
  const value = Number(i.split(' ')[0]);
  const unit = i.split(' ')[1];

  if (unit === 'JPY') {
    total += value;
  } else {
    total += (value * 380000.0);
  }
});

console.log(total);
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [n, ...xy] = stdin.split('\n')
const x_y = xy.map(e=>e.split(' '))
const x = x_y.map(e=>Number(e[0]))
const y = x_y.map(e=>e[1])

function getBCV(b){
  return b * 380000
}

let sum = 0
for (let i = 0; i < x.length; i++) {
  if(y[i] === 'JPY'){
    sum += x[i]
  } else {
    sum += getBCV(x[i])
  }
}

console.log(sum)
//  [python]
#coding: utf-8
X,A,B = map(int, input().split())
if A+X < B:
    print('dangerous')
elif A < B:
    print('safe')
else:
    print('delicious')
//  [python]
x,a,b = map(int, input().split())

if b <= a:
    print('delicious')
elif b-a <= x:
    print('safe') 
else:
    print('dangerous')
//  [python]
x, a, b = [int(x) for x in input().split()]
if a-b >= 0:
    print('delicious')
elif a-b+x >= 0:
    print('safe')
else:
    print('dangerous')
//  [python]
x, a, b = map(int, input().split())
if b <= a:
    print('delicious')
elif b-a <= x:
    print('safe')
else:
    print('dangerous')
//  [python]
x, a, b = map(int, input().split())
if b-a <= 0:
    print("delicious")
elif b-a <= x:
    print("safe")
else:
    print("dangerous")
//  [python]
import numpy as np
import scipy as sp

def main():
    # parse
    X, A, B = parse(get_stdin())
    # compute
    result = compute(X, A, B)
    # show result
    print(result)

def compute(X, A, B):
    if 0 >= B-A:
        return "delicious"
    elif X >= B-A:
        return "safe"
    else:
        return "dangerous"

def get_stdin():
    return input()

def split_stdin(stdin_val, delimiter = ' '):
    return [x for x in stdin_val.split(delimiter) if x != '']

def parse(stdin_vars):
    vars = split_stdin(stdin_vars)
    return int(vars[0]), int(vars[1]), int(vars[2])

if __name__ == "__main__":
    main()
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
public static void main(String[] args) throws IOException {

BufferedReader br =new BufferedReader (new InputStreamReader (System.in));

String line = br.readLine( );
String[] list = line.split(" ");
int x = Integer.parseInt(list[0]);
int a = Integer.parseInt(list[1]);
int b = Integer.parseInt(list[2]);


int n=b-a;
String z = "p";


if(n>0&&x>=n){
z ="safe";
}else if(n<=0){
z="delicious";
}else if(x+1<=n){
z="dangerous";
}
System. out. println(z);
}}
//  [java]


import java.text.DecimalFormat;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        final int X = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt();
        String ans = "dangerous";

        if (B - A <= 0) {
            ans = "delicious";
        } else if (B - A <= X) {
            ans = "safe";
        }

        out.println(ans);

        out.flush();
    }

}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {

    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
  private static String solve(int x, int a, int b) {
    if (b <= a) {
      return "delicious";
    }
    if (b - a <= x) {
      return "safe";
    }
    return "dangerous";
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int x = reader.nextInt();
    int a = reader.nextInt();
    int b = reader.nextInt();
    out.println(solve(x, a, b));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}
//  [java]
import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;

class Solver extends Main{
	Solver(){
		
	}
}//Solver_end

@SuppressWarnings("unchecked")
class Main{
	static int imax=Integer.MAX_VALUE;
	static long lmax=Long.MAX_VALUE;
	
	public static void main(String[] args) throws FileNotFoundException{
		
		Scanner sc=new Scanner(System.in);
		int[] num=readlnI(sc," ");
		int eat=num[0]-num[1]+num[2];
		int lmt=num[0]*2;

		if(eat<=num[0]){
			puts("delicious");
		}else if(num[0]<eat && eat<=lmt){
			puts("safe");
		}else if(lmt<eat){
			puts("dangerous");
		}
		
		new Solver();
	}//main_end
	
//---------------------------------------------------------------------------
	static int readI(Scanner sc){
		return Integer.parseInt(sc.nextLine().trim());
	}
	static long readL(Scanner sc){
		return Long.parseLong(sc.nextLine().trim());
	}
	static String readS(Scanner sc){
		return sc.nextLine().trim();
	}
	static int[] readlnI(Scanner sc, String dl){
		return Arrays.stream(sc.nextLine().trim().split(dl)).mapToInt(Integer::parseInt).toArray();
	}
	static long[] readlnL(Scanner sc, String dl){
		return Arrays.stream(sc.nextLine().trim().split(dl)).mapToLong(Long::parseLong).toArray();
	}
	static String[] readlnS(Scanner sc, String dl){
		return sc.nextLine().trim().split(dl);
	}
	@SuppressWarnings("unchecked")
	static <T> void puts(T... args){
		for(int i=0; i<args.length-1; i++){
			System.out.printf("%s ",args[i]);
		}
		System.out.println(args[args.length-1]);
	}
	static void puts(int[] ary){
		for(int i=0; i<ary.length-1; i++){
			System.out.printf("%d ",ary[i]);
		}
		System.out.println(ary[ary.length-1]);
	}
	static void puts(long[] ary){
		for(int i=0; i<ary.length-1; i++){
			System.out.printf("%d ",ary[i]);
		}
		System.out.println(ary[ary.length-1]);
	}
	static void bs(){
		System.out.println("");
	}
	static int sum(int[] ary){
		int sum=0;
		for(int i=0; i<ary.length; i++) sum+=ary[i];
		return sum;
	}
	static long sum(long[] ary){
		long sum=0;
		for(int i=0; i<ary.length; i++) sum+=ary[i];
		return sum;
	}
	static void tblSort(int[][] tbl){
		Arrays.sort(tbl, new Comparator<int[]>(){
			@Override
			public int compare(int[] a, int[] b){
				if(a[0]==b[0]){
					return b[1]-a[1];
				}else{
					return b[0]-a[0];
				}
			}
		});
	}
}
//  [java]
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int N = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		long x = parseLong(sc.next());
		long a = parseLong(sc.next());
		long b = parseLong(sc.next());
		sc.close();
		long ab = -a + b;
		out.println(ab<=0?"delicious":ab<=x?"safe":"dangerous");
	}
}
//  [java]
import java.util.*;
import java.io.*;

public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    Long[] XAB = Arrays.stream(in.readLine().split(" ")).map(Long::parseLong).toArray(Long[]::new);
    long X = XAB[0];
    long A = XAB[1];
    long B = XAB[2];
    if(A>=B){
      System.out.println("delicious");
    }else if(B<=X+A){
      System.out.println("safe");
    }else{
      System.out.println("dangerous");
    }
  }
}
//  [cpp]
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
	int x,a,b;
	while(scanf("%d%d%d",&x,&a,&b)!=EOF){
		int sum=b-a;
		if(sum<=0)
			printf("delicious\n");
		else if(sum>0&&sum<=x)
			printf("safe\n");
		else
			printf("dangerous\n");	
	}
	return 0;
}
//  [cpp]
#include <cstdio>

using namespace std;

int x, a, b;
int main()
{
    scanf("%d%d%d", &x, &a, &b);
    a = a - b;
    if(a >= 0) printf("delicious");
    else{
        a = -a;
        if(a > x) printf("dangerous");
        else printf("safe");
    }
    return 0;
}
//  [cpp]
#include<cstdio>
int main(){
	int x,a,b;
	scanf("%d %d %d",&x,&a,&b);
	if(b<=a){
		printf("delicious\n");
		
	}else if(b<=a+x){
		printf("safe\n");
	}else{
		printf("dangerous\n");
	}
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  int a,b,x;cin>>x>>a>>b;
  string ans="dangerous";
  if((a-b)>=0)ans="delicious";
  else if((b-a)<=x)ans="safe";
  cout(ans);
  
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main() {
	int X, A, B;
	cin >> X >> A >> B;

	if (B <= A)
		cout << "delicious" << endl;
	else if (A < B && B <= X + A)
		cout << "safe" << endl;
	else 
		cout << "dangerous" << endl;

}
//  [c]
#include <stdio.h>

int main(int argc, char *argv[])
{
	int X, A, B;
	scanf("%d %d %d", &X, &A, &B);

	if ( B-A <= 0 ){
		printf("delicious\n");
	} else if ( B-A <= X ){
		printf("safe\n");
	} else {
		printf("dangerous\n");
	}
	return 0;
}
//  [c]
#include <stdio.h>

int main()
{
	int x,a,b;
	scanf("%d %d %d",&x,&a,&b);
	if(a-b>=0) printf("delicious\n");
	else if ((a+x-b)>=0) printf("safe\n");
	else printf("dangerous\n");
	return 0;
}
//  [c]
#include<stdio.h>

int main(){
  long long int x, a, b;

  scanf("%lld %lld %lld", &x, &a, &b);
  if(a>=b) printf("delicious\n");
  else if(a<b&&b-a<=x) printf("safe\n");
  else if(a<b&&b-a>x) printf("dangerous\n");
  return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main(){
int x,a,b;
scanf("%d%d%d",&x,&a,&b);
if((x>=1 && x<=pow(10,9))&&(a>=1 && a<=pow(10,9)&&(b>=1 && b<=pow(10,9))))
if(b<=a)
{
    printf("delicious\n");
}
else if(b<=(x+a))
{
    printf("safe\n");
}
else {
    printf("dangerous\n");
}
return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    int x, a, b;
    
    scanf("%d %d %d",&x, &a, &b);
    
    if(a>=b){
        printf("delicious\n");
    }else if(a<b && b-a>x){
        printf("dangerous\n");
    }else{
        printf("safe\n");
    }
 
 
    return 0;   
}
//  [c]
#include <stdio.h>
int main()
{
    long long int a,b,x;
    scanf("%lld %lld %lld",&x,&a,&b);
    {
        if( b <= a )
        {
            printf("delicious");
        }
        else if ( b > a + x )
        {
            printf("dangerous");
        }
        else
        {
            printf("safe");
        }
    }
return 0;
}
//  [javascript]
inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')[0].split(' ')
X = inp.shift() * 1
A = inp.shift() * 1
B = inp.shift() * 1
console.log(B - A > X ? 'dangerous' : B - A <= 0 ? 'delicious' : 'safe')
//  [javascript]
    function main(input){
              
    	const args = input.split(' ');
    	const x = parseInt(args[0],10);
      	const a = parseInt(args[1],10);
    	const b = parseInt(args[2],10);
      
    		if(b-a<=0){
    			console.log("delicious");
    			return;
    			}
    		else{
    			if(b-a < x+1){
              		console.log("safe");
    				}
      			else{
              		console.log("dangerous");
            		}
            }
    	}
    main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
'use strict'

const main = (input) => {
    const X = parseInt(input.split(' ')[0])
    const A = parseInt(input.split(' ')[1])
    const B = parseInt(input.split(' ')[2])
    const diff = A - B
    if(diff >= 0){
        console.log('delicious')
    } else if(diff < 0 && diff >= -X){
        console.log('safe')
    } else{
        console.log('dangerous')
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))
//  [javascript]
function Main(input) {
    input = input.split("\n");
    var line = input[0].split(" ");
    var date = parseInt(line[0]);
    var length = parseInt(line[1]);
    var days = parseInt(line[2]);
    
    if(days>date+length){
        console.log("dangerous");
    } else if(days<=date+length && days>date){
        console.log("safe");
    } else {
        console.log("delicious");
    }
 
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'

function main(input) {
  input = input.split(' ').map(v => ~~v)

  const x = input[0]
  const a = input[1]
  const b = input[2]
  const c = a - b

  let ans = ''

  if (c >= 0) {
    ans = 'delicious'
  } else if (x + a >= b) {
    ans = 'safe'
  } else {
    ans = 'dangerous'
  }
  console.log(ans)
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
   input = input.trim();
  const a = input.split(" ").map(Number);
 console.log(a[1]-a[2]>=0 ?"delicious"
		    :a[2]-a[1]>a[0] ?"dangerous"
		    :"safe");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
// 雑 推敲してない
package main

import "fmt"

func main() {
	var X, A, B int
	fmt.Scan(&X, &A, &B)
	if A-B >= 0 {
		fmt.Println("delicious")
	} else if X >= B-A {
		fmt.Println("safe")
	} else {
		fmt.Println("dangerous")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var x, a, b int
	con.Scan(&x, &a, &b)
	if -a+b <= 0 {
		con.Println("delicious")
	} else if -a+b <= x {
		con.Println("safe")
	} else {
		con.Println("dangerous")
	}
	return nil
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var x, a, b int
	fmt.Scan(&x, &a, &b)
	if a >= b {
		fmt.Println("delicious")
	} else if b-a <= x {
		fmt.Println("safe")
	} else {
		fmt.Println("dangerous")
	}
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Expired?
	var X, A, B int
	fmt.Scanf("%d %d %d", &X, &A, &B)

	if B <= A {
		fmt.Println("delicious")
	} else if B <= X+A {
		fmt.Println("safe")
	} else {
		fmt.Println("dangerous")
	}
}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var x, a, b int
  
  fmt.Scanf("%d %d %d", &x, &a, &b)
  
  if a >= b{
    fmt.Printf("delicious")
  }else if a + x >= b{
    fmt.Printf("safe")
  }else{
    fmt.Printf("dangerous")
  }
}
//  [ruby]
a,b,c=gets.split.map(&:to_i)
l = c - b

if l <= 0 && l <= a
  puts "delicious"
elsif l > 0 && l <= a
  puts "safe"
else
  puts "dangerous"
end
//  [ruby]
input = gets.chomp.split
x = input[0].to_i
a = input[1].to_i
b = input[2].to_i

if a >= b
    puts "delicious"
elsif b - a <= x
    puts "safe"
else
    puts "dangerous"
end
//  [ruby]
x,a,b=gets.split.map(&:to_i)
puts a-b >= 0 ? 'delicious' : a+x < b ? 'dangerous' : 'safe'
//  [ruby]
x, a, b = gets().chomp.split("\s").map{|x| x.to_i}

if a >= b
  puts 'delicious'
elsif b - a <= x
  puts 'safe'
else
  puts 'dangerous'
end
//  [ruby]
a,b,c=gets.split.map(&:to_i)
puts a+b-c<0 ? "dangerous" : b-c<0 ? "safe" : "delicious"
//  [ruby]
x, a, b = gets.split.map(&:to_i)
if b <= a
    puts "delicious"
elsif b <= a + x
    puts "safe"
else
    puts "dangerous"
end
//  [rust]
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<u64> = procon_read();
	let x = v[0];
	let a = v[1];
	let b = v[2];
	if b <= a {
		println!("delicious");
	}else if b <= a+x {
		println!("safe");
	}else{
		println!("dangerous");
	}
}
//  [rust]
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::collections::VecDeque;

fn main() {
    let x: i64 = read();
    let a: i64 = read();
    let b: i64 = read();
    if b <= a {
        println!("delicious");
        return;
    }

    if b - a <= x {
        println!("safe");
    } else {
        println!("dangerous");
    }
}
//  [rust]
#![allow(unused)]

use std::cmp::{max, min};
use std::io::stdin;
use std::str::FromStr;

fn input<T: FromStr>() -> Result<T, T::Err> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().parse()
}

fn input_vec<T: FromStr>() -> Result<Vec<T>, T::Err> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().split_whitespace().map(|x| x.parse()).collect()
}

fn main() {
    let v: Vec<i32> = input_vec().unwrap();

    let ans = if v[1] >= v[2] {"delicious"} else if v[0] + v[1] >= v[2] {"safe"} else {"dangerous"};
    println!("{}", ans);
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        x: usize,
        a: usize,
        b: usize,
    }
    if a>=b {
        println!("delicious");
    } else if a<b && b<=(a+x) {
        println!("safe");
    } else {
        println!("dangerous");
    }
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_imports)]
#![allow(dead_code)]

use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;
use num_traits::*;
use superslice::*;
use std::ops::*;

use itertools::Itertools;
use itertools_num::ItertoolsNum;


#[fastout]
fn solve() {
    const MOD: usize = 1_000_000_007;
    const INF: usize = std::usize::MAX;
    
    input!{
        x: isize,
        a: isize,
        b: isize,
    }

    let ans = if b <= a {
        "delicious"
    } else if b - a <= x {
        "safe"
    } else {
        "dangerous"
    };

    println!("{}", ans);
}

fn main() {
    solve()
}

#[cfg(test)]
mod test {
    use super::solve;
}
//  [rust]
#[allow(unused_macros)]
macro_rules ! read_value {($ next : expr , ($ ($ t : tt ) ,* ) ) => {($ (read_value ! ($ next , $ t ) ) ,* ) } ; ($ next : expr , [$ t : tt ; $ len : expr ] ) => {(0 ..$ len ) . map (| _ | read_value ! ($ next , $ t ) ) . collect ::< Vec < _ >> () } ; ($ next : expr , chars ) => {read_value ! ($ next , String ) . chars () . collect ::< Vec < char >> () } ; ($ next : expr , usize1 ) => {read_value ! ($ next , usize ) - 1 } ; ($ next : expr , $ t : ty ) => {$ next () . parse ::<$ t > () . expect ("Parse error" ) } ; }
#[allow(unused_macros)]
macro_rules ! input_inner {($ next : expr ) => {} ; ($ next : expr , ) => {} ; ($ next : expr , $ var : ident : $ t : tt $ ($ r : tt ) * ) => {let $ var = read_value ! ($ next , $ t ) ; input_inner ! {$ next $ ($ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input {(source = $ s : expr , $ ($ r : tt ) * ) => {let mut iter = $ s . split_whitespace () ; let mut next = || {iter . next () . unwrap () } ; input_inner ! {next , $ ($ r ) * } } ; ($ ($ r : tt ) * ) => {let stdin = std :: io :: stdin () ; let mut bytes = std :: io :: Read :: bytes (std :: io :: BufReader :: new (stdin . lock () ) ) ; let mut next = move || -> String {bytes . by_ref () . map (| r | r . unwrap () as char ) . skip_while (| c | c . is_whitespace () ) . take_while (| c |! c . is_whitespace () ) . collect () } ; input_inner ! {next , $ ($ r ) * } } ; }

fn main() {
    input! {
        x: i32,
        a: i32,
        b: i32,
    }

    if b <= a {
        println!("delicious");
    } else if b <= a + x {
        println!("safe");
    } else {
        println!("dangerous");
    }
}
//  [swift]
var i=readLine()!.characters.split(" ").map{Int(String($0))!},a="delicious";if i[1]<i[2]{a="safe";if i[0]+i[1]<i[2]{a="dangerous"}};print(a)