Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program results in two integers x and y (x + y = 10; x, y ≥ 0). These numbers mean that x packets successfully reached the corresponding server through the network and y packets were lost.

Today Polycarpus has performed overall n ping commands during his workday. Now for each server Polycarpus wants to know whether the server is "alive" or not. Polycarpus thinks that the server is "alive", if at least half of the packets that we send to this server reached it successfully along the network.

Help Polycarpus, determine for each server, whether it is "alive" or not by the given commands and their results.


-----Input-----

The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers t_{i}, x_{i}, y_{i} (1 ≤ t_{i} ≤ 2; x_{i}, y_{i} ≥ 0; x_{i} + y_{i} = 10). If t_{i} = 1, then the i-th command is "ping a", otherwise the i-th command is "ping b". Numbers x_{i}, y_{i} represent the result of executing this command, that is, x_{i} packets reached the corresponding server successfully and y_{i} packets were lost.

It is guaranteed that the input has at least one "ping a" command and at least one "ping b" command.


-----Output-----

In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes).

In the second line print the state of server b in the similar format.


-----Examples-----
Input
2
1 5 5
2 6 4

Output
LIVE
LIVE

Input
3
1 0 10
2 0 10
1 10 0

Output
LIVE
DEAD



-----Note-----

Consider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network.

Consider the second test case. There were overall 20 packages sent to server a, 10 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall 10 packets were sent to server b, 0 of them reached it. Therefore, less than half of all packets sent to this server successfully reached it through the network.

Difficulty: competition

Starter code:

Solutions:
n=int(input())
ta,tb,da,db=[0]*4
for i in range (n):
    t,x,y=list(map(int,input().split()))
    if t==1:
        ta+=(x+y)
        da+=y
    if (t==2):
        tb+=(x+y)
        db+=y       
if (ta-da>=0.5*ta):
    print ('LIVE')
else :
    print ('DEAD')
if (tb-db>=0.5*tb):
    print ('LIVE')
else :
    print ('DEAD')    
    


n=int(input())
live1, dead1, live2, dead2 = 0, 0, 0, 0
for i in range(n):
    I=[int(j) for j in input().split()]
    if I[0]==1:
        live1+=I[1]
        dead1+=I[2]
    else:
        live2+=I[1]
        dead2+=I[2]
if live1>=(live1+dead1)/2: print('LIVE')
else: print('DEAD')
if live2>=(live2+dead2)/2: print('LIVE')
else: print('DEAD')

import sys
#f = sys.stdin
# f = open("input.txt", "r")
n = int(input())
a, b = [[],[]], [[],[]]
for i in range(n):
    t, xi, yi = map(int, input().split())
    if t == 1:
        a[0].append(xi)
        a[1].append(yi)
    else:
        b[0].append(xi)
        b[1].append(yi)
if sum(a[0]) >= sum(a[1]):
    print("LIVE")
else:
    print("DEAD")
if sum(b[0]) >= sum(b[1]):
    print("LIVE")
else:
    print("DEAD")

3

n = int(input())
send = [[], []]
for _ in range(n):
    t, x, y = tuple(map(int, input().split()))
    send[t - 1].append(x)
for _ in range(2):
    print('LIVE' if 2 * sum(send[_]) >= 10 * len(send[_]) else 'DEAD')


while(1):
    try:
        n=int(input())
        a,b,c=[0 for j in range(n)],[0 for j in range(n)],[0 for j in range(n)]
        sum1,sum2=0,0
        for i in range(0,n):
            a[i],b[i],c[i]=list(map(int,input().split()))
            if a[i]==1:
                sum1+=b[i]
            else:
                sum2+=b[i]
        count1,count2=a.count(1),a.count(2)
        t1,t2=10*count1,10*count2
        if sum1/t1>=0.5:
            print("LIVE")
        else:
            print("DEAD")
        if sum2/t2>=0.5:
            print("LIVE")
        else:
            print("DEAD")
    except EOFError:
        break
    
        
        
        
        


n = int(input())
u, v = [0, 0], [0, 0]
for i in range(n):
    t, x, y = list(map(int, input().split()))
    k = int(t == 1)
    u[k] += x
    v[k] += y
print('LDIEVAED'[u[1] < v[1] :: 2])
print('LDIEVAED'[u[0] < v[0] :: 2])    


n=int(input())
Ans=""
A=[0,0]
B=[0,0]
for i in range(n):
    l,x,y=list(map(int,input().split()))
    if(l==1):
        A[0]+=x
        A[1]+=10
    else:
        B[0]+=x
        B[1]+=10
if(A[0]/A[1]>=1/2):
    print("LIVE")
else:
    print("DEAD")

if(B[0]/B[1]>=1/2):
    print("LIVE")
else:
    print("DEAD")


n=int(input())
a,ar,b,br=0,0,0,0
for i in range(n):
    x=list(map(int,input().split()))
    if(x[0]==1):
        a+=10
        ar+=x[1]
    else:
        b+=10
        br+=x[1]
print('DLEIAVDE'[ar>=a//2::2])
print('DLEIAVDE'[br>=b//2::2])


n = int(input())
r = [[0,0,0],[0,0,0]]
for i in range(n):
    t,x,y = map(int, input().split())
    if t == 1:
        r[0][0] += 1
        r[0][1] += x
        r[0][2] += y
    else:
        r[1][0] += 1
        r[1][1] += x
        r[1][2] += y
for i in r:
    if i[1] < i[2]:
        print('DEAD')
    else:
        print('LIVE')

n=int(input())
a=0
a1=0
b=0
b1=0
for i in range(n):
    t,x,y=list(map(int,input().split()))
    if t==1:
        a+=x
        a1+=y
    else:
        b+=x
        b1+=y
if a>=a1:
    print('LIVE')
else:
    print('DEAD')
if b>=b1:
    print('LIVE')
else:
    print('DEAD')


c = [[0, 0], [0, 0]]
for i in range(int(input())):
    l = [int(x) for x in input().split()]
    c[l[0] - 1][0] += l[1]
    c[l[0] - 1][1] += l[2]
for i in range(2):
    print('LIVE' if c[i][0] >= c[i][1] else 'DEAD')

n = int(input())
ax = ay = bx = by = 0
for i in range(n):
	x, y, z = [int(t) for t in input().split()]
	if x == 1:
		ax += y
		ay += z
	else:
		bx += y
		by += z
print('LIVE' if ax >= ay else 'DEAD')
print('LIVE' if bx >= by else 'DEAD')


def main():
    n = int(input())
    LIVE, DEAD = [0, 0, 0], [0, 0, 0]
    for _ in range(n):
        t, x, y = map(int, input().split())
        LIVE[t] += x
        DEAD[t] += y
    for _ in 1, 2:
        print(('LIVE', 'DEAD')[LIVE[_] < DEAD[_]])


def __starting_point():
    main()
__starting_point()

n = int(input())
aSended = 0
bSended = 0
aPing = 0
bPing = 0

while n > 0:
    t, x, y = map(int, input().split())
    if t == 1:
        aSended = aSended + 10
        aPing = aPing + x
    elif t == 2:
        bSended = bSended + 10
        bPing = bPing + x
    n = n - 1

if(int(aSended / 2) <= aPing):
    print("LIVE")
else:
    print("DEAD")

if(int(bSended / 2) <= bPing):
    print("LIVE")
else:
    print("DEAD")

s = [[0, 0], [0, 0]]
for i in range(int(input())):
    server, pass_, down = map(int, input().split())
    s[server - 1][0] += pass_
    s[server - 1][1] += down
print('LIVE' if s[0][0] >= s[0][1] else 'DEAD', 'LIVE' if s[1][0] >= s[1][1] else 'DEAD', sep='\n')

from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
from collections import *
setrecursionlimit(10**7)
dX= [-1, 1, 0, 0,-1, 1,-1, 1]
dY= [ 0, 0,-1, 1, 1,-1,-1, 1]
RI=lambda: list(map(int,input().split()))
RS=lambda: input().rstrip().split()
#################################################
n=RI()[0]
ti=[0]*3
tot=[0]*3
for i in range(n):
    t,x,y=RI()
    tot[t]+=x
    ti[t]+=1
for i in (1,2):
    print(["LIVE","DEAD"][ti[i]*5>tot[i]])






n = int(input())
res1success = 0
res1fail = 0
res2success = 0
res2fail = 0
for i in range(n):
    s, x, y = list(map(int, input().split()))
    if s == 1:
        res1success += x
        res1fail += y
    else:
        res2success += x
        res2fail += y

if res1success >= res1fail:
    print("LIVE")
else:
    print("DEAD")

if res2success >= res2fail:
    print("LIVE")
else:
    print("DEAD")


n = int(input())
res1success = 0
res1fail = 0
res2success = 0
res2fail = 0
for i in range(n):
    s, x, y = list(map(int, input().split()))
    if s == 1:
        res1success += x
        res1fail += y
    else:
        res2success += x
        res2fail += y

if res1success >= res1fail:
    print("LIVE")
else:
    print("DEAD")

if res2success >= res2fail:
    print("LIVE")
else:
    print("DEAD")


n = int(input())

a = b = 0
a_success = b_success = 0

for i in range(0, n):
    description = [int(x) for x in input().split()]
    if description[0] == 1:
        a += 1
        a_success += description[1]
    else:
        b += 1
        b_success += description[1]

print(["DEAD", "LIVE"][a_success >= a*5])
print(["DEAD", "LIVE"][b_success >= b*5])



n = int(input())
q = 0
e = 0
w = 0
r = 0
for i in range(n):
    t, x, y = map(int, input().split())
    if(t == 1):
        q+=x
        w+=10
    else:
        e+=x
        r+=10
if(q < w//2):
    print("DEAD")
else:
    print("LIVE")
if(e < r//2):
    print("DEAD")
else:
    print("LIVE")

n=int(input())
na,nb,ca,cb=0,0,0,0 
while n>0:
	x,y,z=map(int,input().split())
	if x==1:
		na+=10
		ca+=y
	else:
		nb+=10
		cb+=y
	n=n-1
if ca*2>=na:
	print('LIVE')
else:
	print('DEAD')

if cb*2>=nb:
	print('LIVE')
else:
	print('DEAD')

def myprint(ca,na):
	if ca*2>=na:
		print('LIVE')
	else:
		print('DEAD')

n=int(input())
na,nb,ca,cb=0,0,0,0 
while n>0:
	x,y,z=map(int,input().split())
	if x==1:
		na+=10
		ca+=y
	else:
		nb+=10
		cb+=y
	n=n-1
myprint(ca,na)
myprint(cb,nb)

n = int(input())
success = [0, 0]
total = [0, 0]
for _ in range(n):
	i, x, y = map(int, input().split())
	total[i-1] += 10
	success[i-1] += x
for i in range(2):
	print("LIVE" if success[i] * 2 >= total[i] else "DEAD")

n = int(input())
a = [[0,0],[0,0]]
for i in range(n):
    t,x,y = map(int, input().split())
    a[t-1][0] += x
    a[t-1][1] += 5
if a[0][0] >= a[0][1]:
    print('LIVE')
else:
    print('DEAD')
if a[1][0] >= a[1][1]:
    print('LIVE')
else:
    print('DEAD')

# from dust i have come dust i will be

n=int(input())

ax=0;bx=0
ay=0;by=0

for i in range(n):
    t,x,y=list(map(int,input().split()))

    if t==1:
        ax+=x
        ay+=y
    else:
        bx+=x
        by+=y

if ax>=(ax+ay)//2:
    print('LIVE')
else:
    print('DEAD')

if bx>=(bx+by)//2:
    print('LIVE')
else:
    print('DEAD')