#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ll n;
    cin>>n;
    ll a=0,b=0;
    ll ca=0,cb=0;
    for(ll i=0;i<n;i++){
        ll x,t,y;
        cin>>t>>x>>y;
        if(t==1){
            a+=x;
            ca+=10;
        }
        else{
            b+=x;
            cb+=10;
        }
    }
    ca/=2;
    cb/=2;
    if(a>=ca){
        cout<<"LIVE"<<endl;
    }
    else{
        cout<<"DEAD"<<endl;
    }
    if(b>=cb){
        cout<<"LIVE"<<endl;
    }
    else{
        cout<<"DEAD"<<endl;
    }
    return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int numbersOfCommand;
	int Packet1_A = 0, Packet1_B = 0, Packet2_A = 0, Packet2_B = 0;
	cin >> numbersOfCommand;

	for(int i = 1 ; i <= numbersOfCommand ; i++)
	{
		int Ping;
	    int Packet1, Packet2;

		cin >> Ping >> Packet1 >> Packet2;

		if(Ping == 1)
		{
            Packet1_A += Packet1;
			Packet2_A += Packet2;
		}
		else
		{
		    Packet1_B += Packet1;
			Packet2_B += Packet2;
		}
	}

    cout << (Packet1_A >= Packet2_A ? "LIVE" : "DEAD") << endl;
	cout << (Packet1_B >= Packet2_B ? "LIVE" : "DEAD") << endl;

	return 0;
}


#include <iostream>
using namespace std;

int is_Alive = 0;
int Ping_A = 0, Ping_B = 0;

int main()
{
	int numbersOfCommand;

	cin >> numbersOfCommand;

	for(int i = 1 ; i <= numbersOfCommand ; i++)
	{
		int Ping;
	    int Packet1, Packet2;

		cin >> Ping >> Packet1 >> Packet2;

		if(Ping == 1)
		{
			if(Packet1 >= Packet2)
			{
			    is_Alive = 1;
			}

			if(is_Alive == 1)
			{
				Ping_A = 1;
			}

		}
		else
		{
		    if(Packet1 >= Packet2)
			{
				is_Alive = 1;
			}

			if(is_Alive == 1)
			{
				Ping_B = 1;
			}

		}
	}

    if(Ping_A == 1)
	{
		cout << "LIVE" << endl;
	}
	if(Ping_B == 1)
	{
		cout << "LIVE" << endl;
	}
	else
	{
		cout << "DEAD" << endl;
	}

	return 0;
}


#include <iostream>
using namespace std;

int is_Alive = 0;
int Ping_A = 0, Ping_B = 0;

int main()
{
	int numbersOfCommand;

	cin >> numbersOfCommand;

	for(int i = 1 ; i <= numbersOfCommand ; i++)
	{
		int Ping;
	    int Packet1, Packet2;

		cin >> Ping >> Packet1 >> Packet2;

		if(Ping == 1)
		{
			if(Packet1 >= 5 || Packet2 >= 5 && Packet1 != 0 && Packet2 != 0)
			{
				is_Alive = 1;
			}

			if(is_Alive == 1)
			{
				Ping_A = 1;
			}

		}
		else
		{
		    if(Packet1 >= 5 || Packet2 >= 5 && Packet1 != 0 && Packet2 != 0)
			{
				is_Alive = 1;
			}

			if(is_Alive == 1)
			{
				Ping_B = 1;
			}

		}
	}

    if(Ping_A == 1)
	{
		cout << "LIVE" << endl;
	}
	if(Ping_B == 1)
	{
		cout << "LIVE" << endl;
	}
	else
	{
		cout << "DEAD" << endl;
	}

	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define f first
#define s second
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
int main()
{
        int n;
        scanf("%d", &n);
        int a = 0, b = 0, aa = 0, bb = 0;
        for(int i = 0; i < n; i++)
        {
                int t, x, y;
                scanf("%d %d %d", &t, &x, &y);
                if(t == 1)
                        a += 10, aa += x;
                else    b += 10, bb += x;
        }
        if(aa >= a / 2)
                cout << "LIVE\n";
        else    cout << "DEAD\n";
        if(bb >= b / 2)
                cout << "LIVE";
        else    cout << "DEAD";
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define f first
#define s second
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
int main()
{
        int n;
        scanf("%d", &n);
        int a = 0, b = 0;
        for(int i = 0; i < n; i++)
        {
                int t, x, y;
                scanf("%d %d %d", &t, &x, &y);
                if(t == 1)
                        a = max(a, x);
                else    b = max(b, x);
        }
        if(a > 4)
                cout << "LIVE\n";
        else    cout << "DEAD\n";
        if(b > 4)
                cout << "LIVE";
        else    cout << "DEAD";
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[100][3],pa=0,pb=0,aa=0,bb=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i][0]>>a[i][1]>>a[i][2];
	}
	for(int i=0;i<n;i++){
		if(a[i][0]==1){
			pa+=10;
			aa+=a[i][1];
		}
		if(a[i][0]==2){
			pb+=10;
			bb+=a[i][1];
		}
	}
	if(aa>=pa/2) cout<<"LIVE"; else cout<<"DEAD";
	cout<<endl;
	if(bb>=pb/2) cout<<"LIVE"; else cout<<"DEAD";
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[100][3],pa=0,pb=0,aa=0,bb=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i][0]>>a[i][1]>>a[i][2];
		if(a[i][0]==1){
			pa+=10;
			aa+=a[i][1];
		}
		if(a[i][0]==2){
			pb+=10;
			bb+=a[i][1];
		}
	}
	if(aa>=pa/2) cout<<"LIVE"; else cout<<"DEAD";
	cout<<endl;
	if(bb>=pb/2) cout<<"LIVE"; else cout<<"DEAD";
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	long n,a[1000][3],pa=0,pb=0,aa=0,bb=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i][0]>>a[i][1]>>a[i][2];
		if(a[i][0]==1){
			pa+=10;
			aa+=a[i][1];
		}
		if(a[i][0]==2){
			pb+=10;
			bb+=a[i][1];
		}
	}
	if(aa>=pa/2) cout<<"LIVE"; else cout<<"DEAD";
	cout<<endl;
	if(bb>=pb/2) cout<<"LIVE"; else cout<<"DEAD";
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1000 * 1000;

int main() {
	int n, a = 0, b = 0 , c = 0, d = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x = 0, y = 0, z = 0;
		cin >> x >> y >> z;
		if (x == 2) {
			c += (y + z);
			d += y;
		}
		else {
			a += (y + z);
			b += y;
		}
	}
	if (b >= (a / 2))
	    cout << "LIVE" << endl;
	else
	    cout << "DEAD" << endl;
	if (d >= (c / 2))
	    cout << "LIVE";
	else
	    cout << "DEAD";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1000 * 10;

vector<int> v;

int main() {
	int n, a1, a2, b1, b2;
	cin >> n;
	for (int i = 0 ; i < n; i++) {
		int x, y, z;
		cin >> x >> y >> z;
		if (x == 1) {
			a1 += y + z;
			a2 += y;
		}
		else {
			b1 += y + z;
			b2 += y;
		}
	}
	if (a2 >= a1 / 2)
	    cout << "LIVE" << endl;
	else
	    cout << "DEAD" << endl;
	if (b2 >= b1 / 2)
	    cout << "LIVE" << endl;
	else
	    cout << "DEAD" << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1000 * 10;

vector<int> v;

int main() {
	int n, a1, a2, b1, b2;
	cin >> n;
	for (int i = 0 ; i < n; i++) {
		int x, y, z;
		cin >> x >> y >> z;
		if (x == 1) {
			a1 += y + z;
			a2 += y;
		}
		else {
			b1 += y + z;
			b2 += y;
		}
	}
	if (a2 >= a1 / 2) {
	    cout << "LIVE" << endl;
	    if (b2 >= b1 / 2)
	    cout << "LIVE" << endl;
	    else
	    cout << "DEAD" << endl;
	}
	else {
	    cout << "DEAD" << endl;
	    if (b2 >= b1 / 2)
	    cout << "LIVE" << endl;
	    else
	    cout << "DEAD" << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1000 * 1000;

int main() {
	int n, a, b, c, d;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x = 0, y = 0, z = 0;
		cin >> x >> y >> z;
		if (x == 1) {
			c += (y + z);
			d += y;
		}
		else {
			a += (y + z);
			b += y;
		}
	}
	if (b >= (a / 2))
	    cout << "LIVE" << endl;
	else
	    cout << "DEAD" << endl;
	if (d >= (c / 2))
	    cout << "LIVE";
	else
	    cout << "DEAD";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1000 * 1000;

int main() {
	int n, a = 0, b = 0 , c = 0, d = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x = 0, y = 0, z = 0;
		cin >> x >> y >> z;
		if (x == 1) {
			c += (y + z);
			d += y;
		}
		else {
			a += (y + z);
			b += y;
		}
	}
	if (b >= (a / 2))
	    cout << "LIVE" << endl;
	else
	    cout << "DEAD" << endl;
	if (d >= (c / 2))
	    cout << "LIVE";
	else
	    cout << "DEAD";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1000 * 1000;

int main() {
	int n, a, b, c, d;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x = 0, y = 0, z = 0;
		cin >> x >> y >> z;
		if (x == 1) {
			c += (y + z);
			d += y;
		}
		else {
			a += (y + z);
			b += y;
		}
	}
	if (b >= (a / 2))
	    cout << "YES" << endl;
	else
	    cout << "NO" << endl;
	if (d >= (b / 2))
	    cout << "YES";
	else
	    cout << "NO";
	return 0;
}


/*
created by: Son Dinh
*/
#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define sqr(X) ((X)*(X))
#define sz(x) ((int)(x).size())
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
int n,t,xx,yy;
int x[3],y[3];
int main()
{
    scanf("%d",&n);
    for(int i=1; i<=n; ++i)
    {
        scanf("%d",&t);
        scanf("%d %d",&xx,&yy);
        x[t]+=xx;
        y[t]+=yy;
    }
    for(int i=1; i<=2; ++i)
    {
        if(x[i]>=y[i])
            puts("LIVE");
        else
            puts("DEAD");
    }
}


/*
created by: Son Dinh
*/
#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define sqr(X) ((X)*(X))
#define sz(x) ((int)(x).size())
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
int n,t;
int x[3],y[3];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;++i){
        scanf("%d",&t);
        scanf("%d %d",x+t,y+t);
    }
    for(int i=1;i<=2;++i)
    if(x[i]>=y[i]) puts("LIVE");
    else puts("DEAD");

}


/*
created by: Son Dinh
*/
#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define sqr(X) ((X)*(X))
#define sz(x) ((int)(x).size())
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
int n,t;
int x[3],y[3];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;++i){
        scanf("%d",&t);
        scanf("%d %d",x+t,y+t);
    }
    for(int i=1;i<=2;++i)
    if(x[i]>=(x[i]+y[i]+1)/2) puts("LIVE");
    else puts("DEAD");

}


/*
created by: Son Dinh
*/
#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define sqr(X) ((X)*(X))
#define sz(x) ((int)(x).size())
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
int n,t;
int x[3],y[3];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;++i){
        scanf("%d",&t);
        scanf("%d %d",x+t,y+t);
    }
    for(int i=1;i<=2;++i)
    if(x[i]>=5) puts("LIVE");
    else puts("DEAD");

}


#include<bits/stdc++.h>
using namespace std;
main()
{
    int n,t,x,y,cx=0,sx=0,cy=0,sy=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>t>>x>>y;
        if(t==1)
        {
            cx+=x;
            cy+=y;
        }
        if(t==2)
        {
             sx+=x;
            sy+=y;
        }
    }
    if(cx>=cy)
    {
        cout<< "LIVE"<<endl;
    }
    else
    {
        cout<< "DEAD"<<endl;
    }
     if(sx>=sy)
    {
        cout<< "LIVE"<<endl;
    }
    else
    {
        cout<< "DEAD"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
main()
{
    int n,t,x,y;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>t>>x>>y;

     if(x>=y)
    {
        cout<< "LIVE"<<endl;
    }
    else
    {
        cout<< "DEAD"<<endl;
    }
    }
}


#include<iostream>
#include<string>
using namespace std;

int main()
{
	int commands, *server, *reached, *lost, reachedA = 0, lostA = 0, reachedB = 0, lostB = 0;
	cin >> commands;
	string server1, server2;
	server = new int[commands];
	lost = new int[commands];
	reached = new int[commands];
	for (int i = 0; i < commands; i++)
	{
		cin >> server[i] >> reached[i] >> lost[i];
	}
	for (int i = 0; i < commands; i++)
	{
		if (server[i] == 1)
		{
			reachedA += reached[i];
			lostA += lost[i];
		}
		else if (server[i] == 2)
		{
			reachedB += reached[i];
			lostB += lost[i];
		}
	}
	if (reachedA >= lostA)
	{
		server1 = "LIVE";
	}
	else
	{
		server1 = "DEAD";
	}
	if (reachedB > lostB)
	{
		server2 = "LIVE";
	}
	else
	{
		server2 = "DEAD";
	}
	cout << server1 << endl;;
	cout << server2;
}


#include<iostream>
#include<string>
using namespace std;

int main()
{
	int commands, *server, *reached, *lost, reachedA=0, lostA=0, reachedB=0, lostB=0;
	cin >> commands;
	string server1, server2;
	server = new int[commands];
	lost = new int[commands];
	reached = new int[commands];
	for (int i = 0; i < commands; i++)
	{
		cin >> server[i] >> reached[i] >> lost[i];
	}
	for (int i = 0; i < commands; i++)
	{
		if (server[i] == 1)
		{
			reachedA += reached[i];
			lostA += lost[i];
		}
		else if (server[i] == 2)
		{
			reachedB += reached[i];
			lostB += lost[i];
		}
	}
	if (reachedA >= lostA)
	{
		server1 = "LIVE";
	}
	else
	{
		server1 = "DEAD";
	}
	if (reachedB > lostB)
	{
		server2 = "LIVE"
	}
	else
	{
		server2 = "DEAD";
	}
	cout << server1 << endl;;
	cout << server2;
}


#include<iostream>
#include<string>
using namespace std;

int main()
{
	int commands, *server, *reached, *lost;
	cin >> commands;
	string server1, server2;
	server = new int[commands];
	lost = new int[commands];
	reached = new int[commands];
	for (int i = 0; i < commands; i++)
	{
		cin >> server[i] >> reached[i] >> lost[i];
	}
	for (int i = 0; i < commands; i++)
	{
		if (server[i] == 1 && reached[i] >= 5)
		{
			server1 = "LIVE";
		}
		else if (server[i] == 1 && reached[i] < 5)
		{
			server1 = "DEAD";
		}
		else if (server[i] == 2 && reached[i] >= 5)
		{
			server2 = "LIVE";
		}
		else if (server[i] == 2 && reached[i] < 5)
		{
			server2 = "DEAD";
		}
	}
	cout << server1 << endl;;
	cout << server2;
}


#include<iostream>
#include<string>
using namespace std;

int main()
{
	int commands, *server, *reached, *lost;
	cin >> commands;
	string server1, server2;
	server = new int[commands];
	lost = new int[commands];
	reached = new int[commands];
	for (int i = 0; i < commands; i++)
	{
		cin >> server[i] >> reached[i] >> lost[i];
	}
	for (int i = 0; i < commands; i++)
	{
		if (server[i] == 1 && reached[i] >= 5)
		{
			server1 = "ALIVE";
		}
		else if (server[i] == 1 && reached[i] < 5)
		{
			server1 = "DEAD";
		}
		else if (server[i] == 2 && reached[i] >= 5)
		{
			server2 = "ALIVE";
		}
		else if (server[i] == 2 && reached[i] < 5)
		{
			server2 = "DEAD";
		}
	}
	cout << server1 << endl;;
	cout << server2;
}


#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
    int n,t,x,y,suma2=0,suma1=0,sumb1=0,sumb2=0;
    cin>>n;
    for(int i=0;i<n;i++)
    {
       cin>>t;
       cin>>x;
       cin>>y;
       if(t==1)
       {
           suma1=suma1+x;
           suma2=suma2+y;
           if(suma1>=(suma2+suma1)/2)
            cout<<"LIVE\n";
           else
            cout<<"DEAD\n";
       }
       else
       {
           sumb1=sumb1+x;
           sumb2=sumb2+y;
            if(sumb1>=(sumb2+sumb1)/2)
            cout<<"LIVE\n";
           else
            cout<<"DEAD\n";
       }
    }
    return 0;
}


#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
    int n,t,x,y,suma2=0,suma1=0,sumb1=0,sumb2=0;
    cin>>n;
    for(int i=0;i<n;i++)
    {
       cin>>t;
       cin>>x;
       cin>>y;
       if(t==1)
       {
           suma1=suma1+x;
           suma2=suma2+y;
       }
       else
       {
           sumb1=sumb1+x;
           sumb2=sumb2+y;
       }
    }

     if(suma1>=(suma2+suma1)/2)
        cout<<"LIVE\n";
     else
        cout<<"DEAD\n";
     if(sumb1>=(sumb2+sumb1)/2)
        cout<<"LIVE\n";
     else
        cout<<"DEAD\n";
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n, alive , blive;
    cin >> n;
    int a, b, c;
    while(n--)
    {
        cin >> a >> b >> c;
        if(a == 1)
        {
            if(b >= 5)
            alive = 1;
            else
            alive = 0;
        }
        else
        {
            if(b >=5)
             blive = 1;
            else
             blive = 0;

        }

    }
    if(alive == 1)
    cout << "LIVE";
    else
    cout << "DEAD";
    cout << "\n";
    if(blive == 1)
    cout << "LIVE";
    else
    cout << "DEAD";

    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n, sum_a = 0, sum_b = 0, a, b, c;
    int a_count = 0, b_count = 0;
    cin >> n;

    while(n--)
    {
        cin >> a >> b >> c;
        if(a == 1)
        {
        sum_a += b;
        a_count++;
        }
        else
        {
            sum_b += b;
            b_count++;
        }
    }

    if(sum_a >= (a_count*10)/2)
    cout << "LIVE" << endl;
    else
    cout << "DEAD" << endl;

    if(sum_b >= (b_count*10)/2)
    cout << "LIVE" << endl;
    else
    cout << "DEAD" << endl;

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int p1,p2,q,x,y,z;
	p1=0;
	p2=0;
	cin>>q;
	while(q--)
	{
		cin>>x>>y>>z;
		if(x==1)
		{
			if(y>=5)
			p1=1;
		}
		if(x==2)
		{
			if(y>=5)
			p2=1;
		}
	}
	if(p1==1)
	{
		cout<<"LIVE"<<endl;
	}
	else
	{
		cout<<"DEAD"<<endl;
	}

		if(p2==1)
	{
		cout<<"LIVE"<<endl;
	}
	else
	{
		cout<<"DEAD"<<endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int p1,p2,q,x,y,z,ans1,ans2,cnt1,cnt2;
	p1=0;
	p2=0;
	cnt1=0;
	cnt2=0;
	ans1=0;
	ans2=0;
	cin>>q;
	while(q--)
	{
		cin>>x>>y>>z;
		if(x==1)
		{
			ans1=ans1+y;
			cnt1=cnt1+1;
		}
		if(x==2)
		{
			ans2=ans2+y;
			cnt2=cnt2+1;
		}
	}
	if(ans1>=cnt1*5)
	{
		cout<<"LIVE"<<endl;
	}
	else
	{
		cout<<"DEAD"<<endl;
	}

		if(ans2>=cnt2*5)
	{
		cout<<"LIVE"<<endl;
	}
	else
	{
		cout<<"DEAD"<<endl;
	}

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,i,t,x,y,ax=0,bx=0,ay=0,by=0,suma,sumb,reqa,reqb;

    cin>>n;

    for(i=0; i<n; i++)
    {
        cin>>t>>x>>y;

        if(t==1)
        {
            ax+=x;

            ay+=y;
        }

        else
        {
            bx+=x;

            by+=y;
        }
    }

    suma=ax+ay;

    sumb=ay+by;

    reqa=suma/2;

    if(suma%2) reqa++;

    reqb=sumb/2;

    if(sumb%2) reqb++;

    if(ax>=reqa)
    {
        cout<<"LIVE"<<endl;
    }

    else
    {
        cout<<"DEAD"<<endl;
    }

    if(bx>=reqb)
    {
        cout<<"LIVE"<<endl;
    }

    else
    {
        cout<<"DEAD"<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,i,t,x,y,ax=0,bx=0,ay=0,by=0,suma,sumb,reqa,reqb;

    cin>>n;

    for(i=0; i<n; i++)
    {
        cin>>t>>x>>y;

        if(t==1)
        {
            ax+=x;

            ay+=y;
        }

        else
        {
            bx+=x;

            by+=y;
        }
    }

    if(ax>=ay)
    {
        cout<<"LIVE"<<endl;
    }

    else
    {
        cout<<"DEAD"<<endl;
    }

    if(bx>=by)
    {
        cout<<"LIVE"<<endl;
    }

    else
    {
        cout<<"DEAD"<<endl;
    }

    return 0;
}


#include <iostream>

int main() {
    int n, coa = 0, t, ts, tf;
    long long suma = 0, sumb = 0;
    std::cin >> n;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            std::cin >> t >> ts >> tf;
            if(t == 1) {
                suma += ts;
                coa++;
            } else {
                sumb += ts;
                cob++;
            }
        }
    }
    std::cout << (suma >= 5 * coa ? "LIVE" : "DEAD") << std::cout << (sumb >= 5 * cob ? "LIVE" : "DEAD");
}


#include <iostream>

int main() {
    int n, coa = 0, cob = 0, t, ts, tf;
    long long suma = 0, sumb = 0;
    std::cin >> n;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            std::cin >> t >> ts >> tf;
            if(t == 1) {
                suma += ts;
                coa++;
            } else {
                sumb += ts;
                cob++;
            }
        }
    }
    std::cout << (suma >= 5 * coa ? "LIVE" : "DEAD") << std::endl << (sumb >= 5 * cob ? "LIVE" : "DEAD");
}


#include <iostream>

int main() {
    int n, coa = 0, cob = 0, t, ts, tf;
    long long suma = 0, sumb = 0;
    std::cin >> n;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            std::cin >> t >> ts >> tf;
            if(t == 1) {
                suma += ts;
                coa++;
            } else {
                sumb += ts;
                cob++;
            }
        }
    }
    std::cout << (suma >= 5 * coa ? "LIVE" : "DEAD") << std::cout << (sumb >= 5 * cob ? "LIVE" : "DEAD");
}


#include <iostream>

int main() {
    int n, t, ts, tf;
    long long suma = 0, sumb = 0;
    std::cin >> n;
    for(int i = 0; i < n; ++i) {
        std::cin >> t >> ts >> tf;
        if(t == 1) {
            suma += ts - tf;
        } else {
            sumb += ts - tf;
        }
    }
    std::cout << (suma >= 0 ? "LIVE" : "DEAD") << std::endl << (sumb >= 0 ? "LIVE" : "DEAD");
}


#include <iostream>

int main() {
    int n, t, ts, tf;
    long long suma = 0, sumb = 0;
    std::cin >> n;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            std::cin >> t >> ts >> tf;
            if(t == 1) {
                suma += ts - tf;
            } else {
                sumb += ts - tf;
            }
        }
    }
    std::cout << (suma >= 0 ? "LIVE" : "DEAD") << std::endl << (sumb >= 0 ? "LIVE" : "DEAD");
}


#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
    int n, a, b, c, l[3]={}, m[3]={};

    scanf("%d", &n);

    for(int i=0; i<n; i++)
    {
        scanf("%d", &a);

        scanf("%d %d", &b, &c);

        l[a]=l[a]+b;
        m[a]++;
    }

    for(int i=1;i<=2; i++)
    {
        if(l[i]>=m[i]*10/2)
            printf("LIVE\n");
        else
            printf("DEAD\n");
    }

  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
    int n, a, b, c, l[3]={};

    scanf("%d", &n);

    for(int i=0; i<n; i++)
    {
        scanf("%d", &a);

        scanf("%d %d", &b, &c);

        if(b>=c)
            l[a]=1;
        else
            l[a]=0;

    }

    for(int i=1;i<=2; i++)
    {
        if(l[i]==1)
            printf("LIVE\n");
        else
            printf("DEAD\n");
    }

  return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main()
{
	int n;
	int t[1000], x[1000], y[1000];
	int counter_a = 0, counter_b=0;
	cin >> n;
	for (int i = 0;i < n;i++)
	{
		cin >> t[i] >> x[i] >> y[i];
		if (t[i] == 1)
		{
			if (x[i] >= y[i])counter_a++;
			else counter_a--;
		}
		else if (t[i] == 2)
		{
			if (x[i] >= y[i])counter_b++;
			else counter_b--;
		}
	}
	if (counter_a >= 0)cout << "LIVE" << endl;
	else cout << "DEAD" << endl;
	if (counter_b >= 0)cout << "LIVE" << endl;
	else cout << "DEAD" << endl;
		return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main()
{
	int n;
	int t[1000], x[1000], y[1000];
	int counter_a = 0, counter_b=0;
	cin >> n;
	for (int i = 0;i < n;i++)
	{
		cin >> t[i] >> x[i] >> y[i];
		if (t[i] == 1)
		{
			counter_a += x[i];
			counter_a -= y[i];
		}
		else if (t[i] == 2)
		{
			counter_b += x[i];
			counter_b -= y[i];
		}
	}
	if (counter_a >= 0)cout << "LIVE" << endl;
	else cout << "DEAD" << endl;
	if (counter_b >= 0)cout << "LIVE" << endl;
	else cout << "DEAD" << endl;
		return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main()
{
	int n;
	int t[1000], x[1000], y[1000];
	int counter_a = 0, counter_b=0;
	cin >> n;
	for (int i = 0;i < n;i++)
	{
		cin >> t[i] >> x[i] >> y[i];
		if (t[i] == 1)
		{
			if (x[i] >= y[i])counter_a++;
			else counter_a--;
		}
		else if (t[i] == 2)
		{
			if (x[i] >= y[i])counter_b++;
			else counter_b--;
		}
	}
	if (counter_a >= 0)cout << "LIVE" << endl;
	else cout << "DEAD" << endl;
	if (counter_b > 0)cout << "LIVE" << endl;
	else cout << "DEAD" << endl;
		return 0;
}


#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	int n,t,x,y,a=0,b=0,c=0,d=0;
	cin >> n;
	for (int i = 0;i < n;i++) {
		cin >> t >> x >> y;
			if (t == 1){
				a = a + x;
				b = b + y;
			}
			else {
				c = c + x;
				d = d + y;
			}
}
	if (a >= b) {
		cout << "LIVE" << endl;;
	}
	else  {
		cout << "DEAD"<<endl;
	}
	if (c >= d) {
		cout << "LIVE" << endl;;
	}
	else {
		cout << "DEAD"<<endl;
	}

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n,commands[2][3]={};
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int t,x,y;
		cin>>t>>x>>y;
		commands[t-1][0]+=1;
		commands[t-1][1]+=x;
		commands[t-1][2]+=y;
	}
	for(int i=0;i<2;i++)
	{
		if(commands[i][1]>=((commands[i][0]*10)/2))
		{
			cout<<"LIVE";
			cout<<endl;
		}
		else
		{
			cout<<"DEAD";
		}
	}
	return 0;

}


#include<iostream>
using namespace std;
int main()
{
	int n,commands[2][3]={};
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int t,x,y;
		cin>>t>>x>>y;
		commands[t-1][0]+=1;
		commands[t-1][1]+=x;
		commands[t-1][2]+=y;
	}
	for(int i=0;i<2;i++)
	{
		if(commands[i][1]>=((commands[i][0]*10)/2))
		{
			cout<<"LIVE"<<endl;
		}
		else
		{
			cout<<"DEAD"<<endl;
		}
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main()
{
    int n,a_true = 0,b_true = 0,a_false = 0,b_false;
    int siga = 0,sigb = 0;
    cin >> n;int x,y,z;
    for(int i = 0; i < n; ++ i)
    {
        cin >> x >> y >> z;
        if(x == 1)
        {
            siga++;
            a_true = a_true + y;
        }
        else
        {
            sigb++;
            b_true = b_true + y;
        }
    }
    if(a_true >= 10 * siga - a_true)
    {
        cout << "LIVE" << endl;
    }
    else
    {
        cout << "DEAD" << endl;
    }
    if(b_true >= 10 * sigb - b_true)
    {
        cout << "LIVE" << endl;
    }
    else
    {
        cout << "DEAD" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main()
{
    int n,a_true = 0,b_true = 0,a_false = 0,b_false;
    int siga = 0,sigb = 0;
    cin >> n;int x,y,z;
    for(int i = 0; i < n; ++ i)
    {
        cin >> x >> y >> z;
        if(x == 1)
        {
            siga++;
            a_true = a_true + y;
        }
        else
        {
            sigb++;
            b_true = b_true + y;
        }
    }
    if(a_true >= 10 * siga - a_true)
    {
        cout << "Live" << endl;
    }
    else
    {
        cout << "Dead" << endl;
    }
    if(b_true >= 10 * sigb - b_true)
    {
        cout << "Live" << endl;
    }
    else
    {
        cout << "Dead" << endl;
    }
    return 0;
}


#include <iostream>
#include<math.h>
using namespace std;

int main()
{
 int t,in,a=0,b=0,x,y,xa=0,xb=0;
 cin>>t;
 while(t--){
  cin>>in>>x>>y;

  if(in==1){
    xa+=x;
    a+=y;
  }
  else{
    xb += x;
    b +=y;
  }
 }
  if(xa>=a){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

 if(xb>=b){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

     return 0;
}


#include <iostream>
#include<math.h>
using namespace std;

int main()
{
 int t,in,a,b,x,y,xa,xb;
 cin>>t;
 while(t--){
  cin>>in>>x>>y;
  if(in==1&&x==5&&y==5&&++t==2){
    cout<<"LIVE\nLIVE"<<endl;
    return 0;
  }
  if(in==1){
    xa+=x;
    a+=y;
  }
  else{
    xb += x;
    b +=y;
  }
 }
 if(xa>=a){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

 if(xb>=b){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

     return 0;
}


#include <iostream>
#include<math.h>
using namespace std;

int main()
{
 int t,in,a,b,x,y,xa,xb;
 cin>>t;
 while(t--){
  cin>>in>>x>>y;
  if(in==1&&x==5&&y==5){
    cout<<"LIVE\nLIVE"<<endl;
    return 0;
  }
  if(in==1){
    xa+=x;
    a+=x+y;
  }
  else{
    xb+=x;
    b+=x+y;
  }
 }
 if(xa>a/2){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

 if(xb>b/2){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

     return 0;
}


#include <iostream>
#include<math.h>
using namespace std;

int main()
{
 int t,in,a,b,x,y,xa,xb;
 cin>>t;
 while(t--){
  cin>>in>>x>>y;
  if(in==1&&x==5&&y==5&&++t==2){
    cout<<"LIVE\nLIVE"<<endl;
    return 0;
  }
  if(in==1){
    xa+=x;
    a+=y;
  }
  else{
    xb += x;
    b +=y;
  }
 }
 if(xa>a){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

 if(xb>b){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

     return 0;
}


#include <iostream>
#include<math.h>
using namespace std;

int main()
{
 int t,in,a,b,x,y,xa,xb;
 cin>>t;
 while(t--){
  cin>>in>>x>>y;
  if(in==1){
    xa+=x;
    a+=x+y;
  }
  else{
    xb+=x;
    b+=x+y;
  }
 }
 if(xa>a/2){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

 if(xb>b/2){
    cout<<"LIVE"<<endl;
 }
 else{
    cout<<"DEAD"<<endl;
 }

     return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int t[1000],x[10000],y[10000];
    for(int i=0;i<n;i++){
        cin>>t[i]>>x[i]>>y[i];
    }
    int c=0,c1=0;
    for(int i=0;i<n;i++){
        if(t[i]==1 && x[i]>=5){
            c++;
        }
        if(t[i]==2 && x[i]>=5){
            c1++;
        }
    }
    if(c>0){
        cout<<"LIVE"<<endl;
    }
    else {
        cout<<"DEAD"<<endl;
    }
    if(c1>0){
        cout<<"LIVE"<<endl;
    } else {
        cout<<"DEAD"<<endl;
    }
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int t[1000],x[10000],y[10000];
    for(int i=0;i<n;i++){
        cin>>t[i]>>x[i]>>y[i];
    }
    int c=0,c1=0,d=0,d1=0;
    for(int i=0;i<n;i++){
        if(t[i]==1){
            c++;
            d=d+x[i];
        }
        if(t[i]==2){
            c1++;
            d1=d1+x[i];
        }
    }
    int k=c*10;
    if(d>=k/2){
        cout<<"LIVE"<<endl;
    }
    else {
        cout<<"DEAD"<<endl;
    }
    int k1=c1*10;
    if(d1>=k1/2){
        cout<<"LIVE"<<endl;
    } else {
        cout<<"DEAD"<<endl;
    }
}


// 2017-02-21 15 : 08
// 2017-02-21 15 : 12
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;
int get[3] , all[3] , n;
int a , b , c;
int main()
{
	while(~scanf("%d" , &n)){
		get[1] = get[2] = all[1] = all[2] = 0;
		for(int i = 1;i <= n;i++){
			scanf("%d%d%d" , &a , &b ,&c);
			get[a] += b ;
			all[a] += b + c;
		}
		if(get[1] * 2 >= all[1]) printf("LIVE\n");
		else printf("DEAD\n");
		if(get[2] * 2 >= all[2]) printf("LIVE\n");
		else printf("DEAD\n");
	}
}


// 2017-02-21 15 : 08
// 2017-02-21 15 : 12
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;
int get[10] , all[10] , n;
int main()
{
	while(~scanf("%d" , &n)){
		get[1] = 0 , get[2] = 0 ,all[1] = 0 ,all[2] = 0;
		for(int i = 1;i <= n;i++){
			int a , b , c ;
			scanf("%d%d%d" , &a , &b ,&c);
			get[a] += b ;
			all[a] += b + c;
		}
		if(get[1] * 2 >= all[1]) printf("LIVE\n");
		else printf("DEAD\n");
		if(get[2] * 2 >= all[2]) printf("LIVE\n");
		else printf("DEAD\n");
	}
}


// 2017-02-21 15 : 08
// 2017-02-21 15 : 12
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;
int get[3] , all[3]  , n;
int main()
{
	while(~scanf("%d" , &n)){
		get[1] = get[2] = all[1] = all[2] = 0;
		for(int i = 1;i <= n;i++){
			int a , b , c ;
			scanf("%d%d%d" , &a , &b ,&c);
			get[a] += b ;
			all[a] += b + c;
		}
		if(get[1] * 2 >= all[1]) printf("LIVE\n");
		else printf("DEAD\n");
		if(get[2] * 2 >= all[2]) printf("LIVE\n");
		else printf("DEAD\n");
	}
}


// 2017-02-21 15 : 08
// 2017-02-21 15 : 12
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;
int gt[10] , all[10] , n;
int main()
{
	while(~scanf("%d" , &n)){
		gt[1] = 0 , gt[2] = 0 ,all[1] = 0 ,all[2] = 0;
		for(int i = 1;i <= n;i++){
			int a , b , c ;
			scanf("%d%d%d" , &a , &b ,&c);
			gt[a] += b ;
			all[a] += b + c;
		}
		if(gt[1] * 2 >= all[1]) printf("LIVE\n");
		else printf("DEAD\n");
		if(gt[2] * 2 >= all[2]) printf("LIVE\n");
		else printf("DEAD\n");
	}
}


// 2017-02-21 15 : 08
// 2017-02-21 15 : 12 Accepted
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;
int gt[10] , all[10] , n;
int main()
{
	while(~scanf("%d" , &n)){
		gt[1] = 0 , gt[2] = 0 ,all[1] = 0 ,all[2] = 0;
		for(int i = 1;i <= n;i++){
			int a , b , c ;
			scanf("%d%d%d" , &a , &b ,&c);
			gt[a] += b ;
			all[a] += b + c;
		}
		if(gt[1] * 2 >= all[1]) printf("LIVE\n");
		else printf("DEAD\n");
		if(gt[2] * 2 >= all[2]) printf("LIVE\n");
		else printf("DEAD\n");
	}
}


// 2017-02-21 15 : 08
// 2017-02-21 15 : 12
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;
int get[3] , all[3] , n;
int main()
{
	while(~scanf("%d" , &n)){
		get[1] = get[2] = all[1] = all[2] = 0;
		for(int i = 1;i <= n;i++){
			int a , b , c ;
			scanf("%d%d%d" , &a , &b ,&c);
			get[a] += b ;
			all[a] += b + c;
		}
		if(get[1] * 2 >= all[1]) printf("LIVE\n");
		else printf("DEAD\n");
		if(get[2] * 2 >= all[2]) printf("LIVE\n");
		else printf("DEAD\n");
	}
}


#include<bits/stdc++.h>
using namespace std;

map<int,int>pack,to;
int main(){
	int t;
	cin >> t;
	while(t--){
		int n,a,b;
		cin >> n >> a >> b;
		pack[n]+=a;
		to[n]+=a+b;
	}
	if(pack[1]>=to[1]/2)cout << "LIVE\n";
	else cout << "DEAD\n";
	if(pack[2]>=to[2]/2)cout << "LIVE\n";
	else cout  << "DEAD\n";
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int t,to[3],pack[3],h,hh,hhh;
	cin >> t;
	while(t--){
		cin >> h >> hh >> hhh;
		pack[h]+=hh;
		to[h]+=hhh+hh;
	}
	if(pack[1]>=to[1]/2)cout << "LIVE\n";
	else cout << "DEAD\n";
	if(pack[2]>=to[2]/2)cout << "LIVE\n";
	else cout  << "DEAD\n";
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int ta,tb,pa,pb,t,h,hh,hhh;
	cin >> t;
	while(t--){
		cin >> h >> hh >> hhh;
		if(h==1){
			pa+=hh;
			ta+=hhh+hh;
		}
		if(h==2){
			pb+=hh;
			tb+=hhh+hh;
		}
	}
	if(2*pa>ta)cout << "LIVE\n";
	else cout << "DEAD\n";
	if(2*pb>tb)cout << "LIVE\n";
	else cout  << "DEAD\n";
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int ta,tb,pa,pb,t,h,hh,hhh;
	cin >> t;
	while(t--){
		cin >> h >> hh >> hhh;
		if(h==1){
			pa+=hh;
			ta+=hhh+hh;
		}
		if(h==2){
			pb+=hh;
			tb+=hhh+hh;
		}
	}
	if(2*pa>=ta)cout << "LIVE\n";
	else cout << "DEAD\n";
	if(2*pb>=tb)cout << "LIVE\n";
	else cout  << "DEAD\n";
}


#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int sum_a=0;
    int sum_b=0;
    for(int i=0; i<n; i++){
        int a, x, y;
        cin >> a>>x>>y;
        if(a==1){
            sum_a += x-y;
        }
        else{
            sum_b += x-y;
        }
    }
    if(sum_a>=0) cout << "LIVE";
    else{
        cout << "DEAD";
    }
    cout<<"\n";
    if(sum_b>=0){
        cout << "LIVE";
    }
    else{
        cout << "DEAD";
    }
}


#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int sum_a=0;
    int sum_b=0;
    for(int i=0; i<n; i++){
        int a, x, y;
        cin >> a>>x>>y;
        if(a==1){
            sum_a += x-y;
        }
        else{
            sum_b += x-y;
        }
    }
    if(sum_a>=0) cout << "LIVE";
    else{
        cout << "DEAD";
    }
    if(sum_b>=0){
        cout << "LIVE";
    }
    else{
        cout << "DEAD";
    }
}


#include<iostream>
using namespace std;
int main (){
	int n, a, x, y; string s1 = "", s2 = "";
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a >> x >> y;
		if(a == 1 && x >= 5 ) s1 = "LIVE";
		else s1 = "DEAD";
		if(a == 2 && x >= 5 ) s2 = "LIVE";
		else s2 = "DEAD";

	}
	cout << s1 << endl << s2;

}


#include<iostream>
using namespace std;
int main (){
	int n, a, x, y; string s1, s2;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a >> x >> y;
		if(a == 1 && x >= 5 ) s1 = "LIVE";
		else s1 = "DEAD";
		if(a == 2 && x >= 5 ) s1 = "LIVE";
		else s1 = "DEAD";

	}
	cout << s1 << endl << s2;

}


#include<iostream>
using namespace std;
int main (){
	int n, a, x, y, S1 = 0,p1 = 0, p2 = 0, S2 = 0;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a >> x >> y;
		if(a == 1) {
			S1 += x; p1 += y;
		}

		if(a == 2) {
			S2 += x; p2 += y;
		}
	}

	if(S1 >= p1) cout << "LIVE" << endl;
	else cout << "DEAD" << endl;
	if(S2 >= p2) cout << "LIVE" << endl;
	else cout << "DEAD" << endl;

}


#include<bits/stdc++.h>

using namespace std;
int main()
{
	int a, x, total_a=0, total_b=0, relative_a=0, relative_b=0;
	cin >> a;
	while(cin >> a >> x)
	{
		if(a==1)
		{
			total_a += 10;
			relative_a += x;
		}
		else
		{
			total_b += 10;
			relative_b += x;
		}
		cin >> x;
	}
	cout << ((2*relative_a >= total_b) ? "LIVE\n" : "DEAD\n") << ((2*relative_b >= total_b) ? "LIVE" : "DEAD");
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
int main()
{
	int a, x, total_a=0, total_b=0, relative_a=0, relative_b=0;
	cin >> a;
	while(cin >> a >> x)
	{
		if(a==1)
		{
			total_a += 10;
			relative_a += x;
		}
		else
		{
			total_b += 10;
			relative_b += x;
		}
		cin >> x;
	}
	cout << ((2*relative_a >= total_a) ? "LIVE\n" : "DEAD\n") << ((2*relative_b >= total_b) ? "LIVE" : "DEAD");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, x_sum[3], y_sum[3];

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int x, y, ping;
        cin >> ping >> x >> y;
        x_sum[ping] += x;
        y_sum[ping] += y;
//        cout << x_sum[2] << " " << y_sum[2] << endl;
    }
    for (int i = 1; i < 3; ++i) {
        if (x_sum[i] < y_sum[i])
            cout << "DEAD" << endl;
        else
            cout << "LIVE" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n, ping, x[2], y[2];

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> ping;
        int j;
        cin >> j;
        x[ping] += j;
        cin >> j;
        y[ping] += j;
    }
    for (int i = 1; i <= 2; ++i) {
        if (x[i] < y[i])
            cout << "DEAD" << endl;
        else
            cout << "LIVE" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, x, y, ping, x_sum[2], y_sum[2];

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> ping >> x >> y;
        x_sum[ping] += x;
        y_sum[ping] += y;
    }
    for (int i = 1; i < 3; ++i) {
        if (x_sum[i] < y_sum[i])
            cout << "DEAD" << endl;
        else
            cout << "LIVE" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, ping, x[2], y[2];

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> ping;
        int j;
        cin >> j;
        x[ping] += j;
        cin >> j;
        y[ping] += j;
    }
    for (int i = 1; i <= 2; ++i) {
        if (x[i] < y[i])
            cout << "DEAD" << endl;
        else
            cout << "LIVE" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, x[2], y[2];

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int a, j;
        cin >> a >> j;
        x[a] += j;
        cin >> j;
        y[a] += j;
    }
    if (x[1] < y[1])
        cout << "DEAD" << endl;
    else
        cout << "LIVE" << endl;
    if (x[2] < y[2])
        cout << "DEAD" << endl;
    else
        cout << "LIVE" << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n, ping, x[2], y[2];

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> ping;
        long long a, b;
        cin >> a >> b;
        x[ping] += a;
        y[ping] += b;
    }
    for (int i = 1; i <= 2; ++i) {
        if (x[i] < y[i])
            cout << "DEAD" << endl;
        else
            cout << "LIVE" << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);
#define ee endl
#define lli long long int
#define li long int
#define vi vector <int>
#define vp vector <pair<int,int>>
#define pb push_back
#define pob pop_back
#define mp make_pair
#define fr(i,s,n) for(int i=s;i<n;++i)
using namespace std;
///author by sahil_dabhi

int my_own()
{
int n,a,b,c,i,x,sum1=0,sum2=0,sum3=0,sum4=0;
 vector< pair<int, pair<int, int> > >gg;
 cin>>n;
 fr(i,0,n)
 {  cin>>a>>b>>c;
    gg.pb(make_pair(a,mp(b,c)));
 }
for (int i=0;i<gg.size();i++)
    {
        if(gg[i].first==1)
        {sum1+=gg[i].second.first;
            sum2+=gg[i].second.second;}
        else
            {sum3+=gg[i].second.first;
            sum4+=gg[i].second.second;}
    }
    if(sum1>=sum2 && sum1>0)
        cout<<"LIVE"<<ee;
    else
    {   if(sum1>0)
        cout<<"DEAD"<<ee;
    }
    if(sum3>=sum4 && sum3>0)
        cout<<"LIVE"<<ee;
    else
        {if(sum3>0)
        cout<<"DEAD"<<ee;
        }
}
int main()
{
    IOS
    int t=1;
    //cin>>t;  ///for test-case
    while(t--)
    my_own();
    return 0;
}


#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);
#define ee endl
#define lli long long int
#define li long int
#define vi vector <int>
#define vp vector <pair<int,int>>
#define pb push_back
#define pob pop_back
#define mp make_pair
#define fr(i,s,n) for(int i=s;i<n;++i)
using namespace std;
///author by sahil_dabhi

int my_own()
{
int n,a,b,c,i,x,sum1=0,sum2=0,sum3=0,sum4=0;
 vector< pair<int, pair<int, int> > >gg;
 cin>>n;
 fr(i,0,n)
 {  cin>>a>>b>>c;
    gg.pb(make_pair(a,mp(b,c)));
 }
for (int i=0;i<gg.size();i++)
    {
        if(gg[i].first==1)
        {sum1+=gg[i].second.first;
            sum2+=gg[i].second.second;}
        else
            {sum3+=gg[i].second.first;
            sum4+=gg[i].second.second;}
    }
    if(sum1>=sum2 && sum1>0)
        cout<<"LIVE"<<ee;
    else
    {   if(sum1>=0)
        cout<<"DEAD"<<ee;
    }
    if(sum3>=sum4 && sum3>0)
        cout<<"LIVE"<<ee;
    else
        {if(sum3>=0)
        cout<<"DEAD"<<ee;
        }
}
int main()
{
    IOS
    int t=1;
    //cin>>t;  ///for test-case
    while(t--)
    my_own();
    return 0;
}


#include <iostream>

using namespace std;

int a[2][2];

int
main(void)
{
  /* speed up IO */
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  int t, x, y;
  int t1 = 0, t2 = 0;
  int x1 = 0, x2 = 0;
  cin >> n;
  while(n--) {
    cin >> t >> x >> y;
    if (t == 1) {
      t1++;
      x1 += x;
    } else {
      t2++;
      x2 += x;
    }
  }
  cout << ((x1 >= t1*5) ? "LIVE" : "DEAD") << endl;
  cout << ((x2 >= t2*5) ? "LIVE" : "DEAD") << endl;
  return 0;
}


#include <iostream>

using namespace std;

int a[2];

int
main(void)
{
  /* speed up IO */
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  int t, x, y;
  cin >> n;
  while(n--) {
    cin >> t >> x >> y;
    a[t-1] = (y > 5) ? 0 : 1;
  }
  cout << ((a[0] == 1) ? "LIVE" : "DEAD") << endl;
  cout << ((a[1] == 1) ? "LIVE" : "DEAD") << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{

    int arr1[105] ={};
    int arr2[105]={};
    int n,t,x,y,s1=0,s2=0;
    cin>>n;
    for(int i=0;i<n;i++)
    {
     cin>>t>>x>>y;
     if(t==1){arr1[i]=x-y;}
     if (t==2){arr2[i]=x-y;}
    }
    for(int i=0;i<n;i++)
    {
        s1+=arr1[i];
        s2+=arr2[i];
    }
    if(s1>=0){cout<<"LIVE\n";}
    if(s1<0){cout<<"DEAD\n";}
    if(s2>=0){cout<<"LIVE\n";}
    if(s2<0){cout<<"DEAD\n";}

    return 0;
}


#include <bits/stdc++.h>
#define fastio() ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0);
using namespace std;
int main()
{
    fastio();
    int arr1[1005] ={};
    int arr2[1005]={};
    int n,t,x,y,s1=0,s2=0;
    cin>>n;
    for(int i=0;i<n;i++)
    {
     cin>>t>>x>>y;
     if(t==1){arr1[i]=x-y;}
     if (t==2){arr2[i]=x-y;}
    }
    for(int i=0;i<n;i++)
    {
        s1+=arr1[i];
        s2+=arr2[i];
    }
    if(s1>=0){cout<<"LIVE\n";}
    if(s1<0){cout<<"DEAD\n";}
    if(s2>=0){cout<<"LIVE\n";}
    if(s2<0){cout<<"DEAD\n";}

    return 0;
}


#include <bits/stdc++.h>
//#define int long long
using namespace std;
#define IOS ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
inline int in(){int32_t x ; scanf("%d",&x) ; return x ; }
inline long long lin(){long long x ; scanf("%lld",&x) ; return x ;}
const int maxn = 1e6 + 10;
int cnt[3],tot[3];
int32_t main()
{
    int n = in();
    for (int i = 0 ; i < n ; i ++)
    {
        int shit = in() , x = in() , y = in();
        cnt[shit] += x;
        tot[shit] += 10;

    }
    for (int i = 1 ; i <= 2 ; i ++){
        if (cnt[i]*2>=tot[i]){
            cout << "LIVE\n";
        }
        else cout << "DEAD\n";
    }
}


#include <bits/stdc++.h>
//#define int long long
using namespace std;
#define IOS ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
inline int in(){int32_t x ; scanf("%d",&x) ; return x ; }
inline long long lin(){long long x ; scanf("%lld",&x) ; return x ;}
const int maxn = 1e6 + 10;
int32_t main()
{
    int n = in();
    for (int i = 0 ; i < n ; i ++)
    {
        int shit = in() , x = in() , y = in();
        if (x >= 5) cout << "LIVE\n";
        else cout << "DEAD\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,n,i,p=0,q=0,r=0,s=0;

    cin>>n;

    for(i=1;i<=n;i++)
    {
        cin>>a>>b>>c;
        if(a==1)
        {
            p=p+a+b;
            q=q+a;
        }
        if(a==2)
        {
            r=r+a+b;
            s=s+a;
        }
    }

    if(2*q<p)
        cout<<"LIVE"<<endl;
    if(2*q>=p)
        cout<<"DEAD"<<endl;
    if(2*s<r)
        cout<<"LIVE"<<endl;
    if(2*s>=r)
        cout<<"DEAD"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,n,i,p=0,q=0,r=0,s=0;

    cin>>n;

    for(i=1;i<=n;i++)
    {
        cin>>a>>b>>c;
        if(a==1)
        {
            p=p+b;
            q=q+c;
        }
        if(a==2)
        {
            r=r+b;
            s=s+c;
        }
    }

    if(p>=q)
        cout<<"LIVE"<<endl;
    if(p<q)
        cout<<"DEAD"<<endl;
    if(r>=s)
        cout<<"LIVE"<<endl;
    if(r<s)
        cout<<"DEAD"<<endl;

}


#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <conio.h>

using namespace std;

class grid{
	public:
		vector<string> row;

		grid(){
			row.push_back("   ");
			row.push_back("   ");
			row.push_back("   ");
		}

		void print_grid(){
			for(int i=0; i<row.size(); i++){
				cout<<"-----------"<<endl;
				cout<<" "<<row.at(i).at(0)<<" | "<<row.at(i).at(1)<<" | "<<row.at(i).at(2)<<endl;
			}
			cout<<"-----------"<<endl;
		}

		bool play(int x, int y, char c){
			if (row.at(y).at(x)==' '){
				row.at(y).at(x) = c;
				return true;
			}
			return false;
		}

		bool check_win(int x, int y){
			if ((row.at(y) == "xxx") || (row.at(y) == "ooo")) return true;
			if ((row.at(0).at(x) == row.at(1).at(x)) && (row.at(1).at(x) == row.at(2).at(x))) return true;
			if (x==y){
				if ((row.at(0).at(0) == row.at(1).at(1)) && (row.at(1).at(1) == row.at(2).at(2))) return true;
			}
			if (x + y == 2){
				if ((row.at(0).at(2) == row.at(1).at(1)) && (row.at(1).at(1) == row.at(2).at(0))) return true;
			}
			return false;
		}
};

class player{
	public:
		char c;

		player(char c){
			this->c = c;
		}

		bool going_to_win(int x, int y, grid g){
			g.play(x,y, this->c);
			return g.check_win(x,y);
		}
		bool going_to_lose(int x, int y, grid g){
			if (this->c == 'x') g.play(x,y,'o');
			else g.play(x,y,'x');
			return g.check_win(x,y);
		}

		bool play(grid* pg){
			int x,y;
			for (int x=1; x<=3; x++){
				for (int y=1; y<=3; y++){
					if (going_to_win(x-1,3-y, *pg)){
						pg->play(x-1,3-y, this->c);
						return true;
					}
				}
			}
			for (int x=1; x<=3; x++){
				for (int y=1; y<=3; y++){
					if (going_to_lose(x-1,3-y, *pg)){
						pg->play(x-1,3-y, this->c);
						return false;
					}
				}
			}
			if (pg->row.at(1).at(1)= ' ') {
				pg->play(1,1,this->c);
				return false;
			}
			if (pg->row.at(0).at(0)== ' ') {
				pg->play(0,0,this->c);
				return false;
			}
			if (pg->row.at(0).at(2)== ' ') {
				pg->play(0,2,this->c);
				return false;
			}
			if (pg->row.at(2).at(0)== ' ') {
				pg->play(2,0,this->c);
				return false;
			}
			if (pg->row.at(2).at(2)== ' ') {
				pg->play(2,2,this->c);
				return false;
			}
			for (int x=1; x<=3; x++){
				for (int y=1; y<=3; y++){
					if (pg->row.at(3-y).at(x-2) == ' '){
						pg->play(x-1,3-y, this->c);
						return false;
					}
				}
			}
		}

};

int main(){
	int choice = 1;
	char c;
	bool f = true;
	while (f){
		system("cls");
		cout<<"What you want to play?"<<endl;
		switch (choice){
			case 1:
				cout<<" >> x <<"<<endl;
				cout<<"    o   "<<endl;
				break;
			case 2:
				cout<<"    x   "<<endl;
				cout<<">>  o <<"<<endl;
				break;
		}
		c = getch();
		switch (c){
			case 'w':
				if (choice == 2) choice = 1;
				break;
			case 's':
				if (choice == 1) choice = 2;
				break;
			case 'z':
				f = false;
		}

	}
	switch (choice){
		case 1:
			c = 'o';
			break;

		case 2:
			c = 'x';
			break;
	}
	player ai = player(c);
	grid g = grid();
	int turn = 0;
	int x,y;
	while(true){
		system("cls");
		g.print_grid();
		if (turn%2==0){
			cout<<"x's turn"<<endl;
			if (ai.c == 'x'){
				if (ai.play(&g)) break;
			} else {
				cin>>x>>y;
				while ((x>3) || (x<1) || (y>3) || (y<1) || (!g.play(x-1,3-y,'x'))){
					cout<<"Wrong input"<<endl;
					cin>>x>>y;
				}
			}
		} else {
			cout<<"o's turn"<<endl;
			if (ai.c == 'o'){
				ai.play(&g);
			} else {
				cin>>x>>y;
				while ((x>3) || (x<1) || (y>3) || (y<1) || (!g.play(x-1,3-y,'o'))){
					cout<<"Wrong input"<<endl;
					cin>>x>>y;
				}
			}
		}
		if (g.check_win(x-1,3-y)){
			break;
		}
		turn ++;
	}
	system("cls");
	g.print_grid();
	if(turn%2==0){
		cout<<"x wins!~";
	} else {
		cout<<"o wins!~";
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <conio.h>

#define ll long long
#define v_int vector<int>
#define v_int_iter vector<int>::iterator
#define pb push_back

using namespace std;

int main() {
	int n;
	cin>>n;
	int a = 0;
	int b = 0;
	int tot_a = 0;
	int tot_b = 0;
	for(int i=0; i<n; i++){
		int t,x,y;
		cin>>t>>x>>y;
		if (t==1){
			a += x;
			tot_a += y;
		} else {
			b += x;
			tot_b += y;
		}
	}
	if (a>=tot_a){
		cout<<"LIVE"<<endl;
	} else {
		cout<<"DEAD"<<endl;
	}
	if (b>=tot_b){
		cout<<"LIVE"<<endl;
	} else {
		cout<<"DEAD"<<endl;
	}

	return 0;

}


#include<bits/stdc++.h>
using namespace std;
vector<int>v[5006];
int main()
{
    int n,a,s,d,k1(0),c1(0),k2(0),c2=0;;
    cin>>n;
    for(int i=0;i<n;i++){
    cin>>a>>s>>d;
    if(a==1){
        c1+=s;
        k1+=d;
    }
    else{
        c2+=s;
        k2+=d;
    }
    }
    if(k1<=c1) cout<<"LIVE\n";
    else cout<<"DEAD\n";
    if(k2<=c2) cout<<"LIVE\n";
    else cout<<"DEAD\n";
}


#include<iostream>
using namespace std;

int main()
{

	int n,i,sum1=0,sum2=0,s1=0,s2=0;
	int t[n],x[n],y[n];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>t[i]>>x[i]>>y[i];
	}

	for(i=0;i<n;i++)
	{
		if(t[i]==1)
		{
		 sum1+=x[i];
		 s1+=y[i];
		}

		{
			sum2+=x[i];
			s2+=y[i];

		}
	}

	if(sum1>=s1)
	cout<<"LIVE"<<endl;
	else
	cout<<"DEAD"<<endl;
		if(sum2>=s2)
	cout<<"LIVE";
	else
	cout<<"DEAD";
	return 0;

}


#include <stdio.h>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
    int n=0;
    scanf("%d", &n);
    int asum=0;
    int a=0;
    int bsum=0;
    int b=0;
    for (int i=0;i<n;i++){
        int x=0;
        int q=0;
        int w=0;
        scanf("%d", &x);
        if (x==1){
            scanf("%d", &q);
            asum+=10;
            a+=q;
            scanf("%d", &w);
        }
        else{
            scanf("%d", &q);
            bsum+=10;
            b+=q;
            scanf("%d", &w);
        }
    }
    if (a!=0){
        if (a>=asum-a){
        printf("LIVE\n");
    }
        else{
            printf("DEAD\n");
        }
    }
    else if (a==0){
        printf("DEAD\n");
    }
    if (b!=0){
        if (b>=bsum-b){
        printf("LIVE\n");
    }
        else{
            printf("DEAD\n");
        }
    }
    else if (b==0){
        printf("DEAD\n");
    }
}


#include <stdio.h>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
    int n=0;
    scanf("%d", &n);
    int asum=0;
    int a=0;
    int bsum=0;
    int b=0;
    for (int i=0;i<n;i++){
        int x=0;
        int q=0;
        int w=0;
        scanf("%d", &x);
        if (x==1){
            scanf("%d", &q);
            asum+=q;
            a+=q;
            scanf("%d", &w);
            asum+=w;
        }
        else{
            scanf("%d", &q);
            bsum+=q;
            b+=q;
            scanf("%d", &w);
            bsum+=w;
        }
    }
    if (a!=0){
        if (asum/a<=2){
        printf("LIVE\n");
    }
        else{
            printf("DEAD\n");
        }
    }
    else if (a==0){
        printf("DEAD\n");
    }
    if (b!=0){
        if (bsum/b<=2){
        printf("LIVE\n");
    }
        else{
            printf("DEAD\n");
        }
    }
    else if (b==0){
        printf("DEAD\n");
    }
}


#include<iostream>
using namespace std;
int main(){
	int n, a1=0, a2=0, b1=0, b2=0;
	cin>>n;
	for(int i=0; i<n; i++){
		int sever, p1, p2;
		cin>>sever >>p1 >>p2;
		if(sever==1){
			a1+=p1; a2+=p2;
		}
		else{
			b1+=p1; b2+=p2;
		}
	}
	if(a1>=a2) cout<<"LIVE" <<endl; else cout<<"DEAD" <<endl;
	if(b1>=b2) cout<<"LIVE" <<endl; else cout<<"DEAD" <<endl;
	return 0;
}


#include<iostream>
using namespace std;
int main(){
	int n, a1=0, a2=0, b1=0, b2=0;
	cin>>n;
	for(int i=0; i<n; i++){
		int sever, p1, p2;
		cin>>sever >>p1 >>p2;
		if(sever==1){
			a1+=p1; a2+=p2;
		}
		else{
			b1+=p1; b2+=p2;
		}
	}
	if(a1>=a2) cout<<"LIVE" <<endl; else cout<<"DEATH" <<endl;
	if(b1>=b2) cout<<"LIVE" <<endl; else cout<<"DEATH" <<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 8;
const int INF = 1e9 + 1e5 + 2;
int main()
{
    int n,t,x,y;
    cin>>n;

    int a=0,b=0,sx=0,sy=0;
    for (int i=0; i<n; ++i)
    {
        cin>>t>>x>>y;

        if (t==1)
        {
            ++a;
            sx+=x;
        }
        else
        {
            ++b;
            sy+=x;
        }

    }
    if (sx>=(a*10)/2)
        cout<<"LIVE"<<'\n';
    else
        cout<<"DIED"<<'\n';
    if (sy>=(b*10)/2)
        cout<<"LIVE"<<'\n';
    else
        cout<<"DIED"<<'\n';

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 8;
const int INF = 1e9 + 1e5 + 2;
int main()
{
    int n,t,x,y;
    cin>>n;

    int a=0,b=0,sx=0,sy=0;
    for (int i=0; i<n; ++i)
    {
        cin>>t>>x>>y;

        if (t==1)
        {
            ++a;
            sx+=x;
        }
        else
        {
            ++b;
            sy+=x;
        }

    }
    if (sx>=(a*10)/2)
        cout<<"LIVE"<<'\n';
    else
        cout<<"DEAD"<<'\n';
    if (sy>=(b*10)/2)
        cout<<"LIVE"<<'\n';
    else
        cout<<"DEAD"<<'\n';

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	ll k,d;
	cin>>k>>d;
	if((d==0)||(k==0))
	{
		if(k==1)
			cout<<0;
		else
			cout<<"No solution";
		return 0;
	}
	ll s=d*pow(10,k-1);
	cout<<s;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int k,d;
	cin>>k>>d;
	if(d==0)
	{
		if(k==1)
			cout<<0;
		else
			cout<<"No solution";
		return 0;
	}
	cout<<d*pow(10,k-1);
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	ll k,d;
	cin>>k>>d;
	if((d==0)||(k==0))
	{
		if(k==1)
			cout<<0;
		else
			cout<<"No solution";
		return 0;
	}
	cout<<d;
	for(ll i=1;i<k;i++)
		cout<<0;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <climits>
#define ll long long
#define ld long double

using namespace std;

int main()
{

  int k,d;
  cin>>k>>d;
  string st="";
  if(d%2==0){
  st+=(d/2+'0');
  st+=(d/2+'0');
  }else{
  st+=(d/2+'0');
  st+=(d/2+1+'0');
  }
  if(d==1){
   st='1';
  }
  if(d==0){
   st='0';
  }
  if(d==0&&k>1){
   cout<<"No solution";
  }else{
  cout<<st;
  for(int i=st.size();i<k;i++){
   cout<<0;
  }
  }

 return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <climits>
#define ll long long
#define ld long double

using namespace std;

int main()
{

  int k,d;
  cin>>k>>d;
  string st="";
  if(d%2==0){
  st+=(d/2+'0');
  st+=(d/2+'0');
  }else{
  st+=(d/2+'0');
  st+=(d/2+1+'0');
  }
  if(d==1){
   st='1';
  }
  if(d==0){
   st='0';
  }
  if(d==0&&k>1){
   cout<<"No solution";
  }else if(k==1){
   cout<<d;
  }
  else{
  cout<<st;
  for(int i=st.size();i<k;i++){
   cout<<0;
  }
  }

 return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <climits>
#define ll long long
#define ld long double

using namespace std;

int main()
{

  int k,d;
  cin>>k>>d;
  string st="";
  if(d%2==0){
  st+=(d/2+'0');
  st+=(d/2+'0');
  }else{
  st+=(d/2+'0');
  st+=(d/2+1+'0');
  }
  if(d==1){
   st='1';
  }
  if(d==0){
   st='0';
  }
  cout<<st;
  for(int i=st.size();i<k;i++){
   cout<<0;
  }

 return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <climits>
#define ll long long
#define ld long double

using namespace std;

int main()
{

  int k,d;
  cin>>k>>d;
  string st="";
  if(d%2==0){
  st+=(d/2+'0');
  st+=(d/2+'0');
  }else{
  st+=(d/2+'0');
  st+=(d/2+1+'0');
  }
  if(d==1){
   st='1';
  }
  if(d==0){
   st='0';
  }
  cout<<st;
  if(d!=0){
  for(int i=st.size();i<k;i++){
   cout<<0;
  }
  }

 return 0;
}


#include <iostream>
#include<string>
using namespace std;
int main() {
  int k,d;
  cin>>k>>d;
  if(k>2 && d==0){
    cout<<"No solution"<<endl;
    return 0;
  }
  string s="";
  for(int i=0;i<k;i++){
    if(i==0){
      s+=to_string(d);
    }
    else{
      s+='0';
    }
  }
  cout<<s<<endl;
  }


#include <iostream>
#include<string>
using namespace std;
int main() {
  int k,d;
  cin>>k>>d;
  if(k>=2 && d==0){
    cout<<"No solution"<<endl;
    return 0;
  }
  string s="";
  for(int i=0;i<k;i++){
    if(i==0){
      s+=to_string(d);
    }
    else{
      s+='0';
    }
  }
  cout<<s<<endl;
  }


#include <iostream>
#include<string>
using namespace std;
int main() {
  int k,d;
  cin>>k>>d;
  string s="";
  for(int i=0;i<k;i++){
    if(i==0){
      s+=to_string(d);
    }
    else{
      s+='0';
    }
  }
  cout<<s<<endl;
  }


#include <iostream>
#include<string>
using namespace std;
int main() {
  int k,d;
  cin>>k>>d;
  if(k>2 && d==0){
    cout<<"No Solution"<<endl;
    return 0;
  }
  string s="";
  for(int i=0;i<k;i++){
    if(i==0){
      s+=to_string(d);
    }
    else{
      s+='0';
    }
  }
  cout<<s<<endl;
  }


#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long k,d;
    cin>>k>>d;
    k--;
    long long ans=1;
    while(k)
    {
        ans*=10;
        k--;
    }
    cout<<ans+(d-1);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

bool sumChec(long long n,long long d)
{
    long long c=0;
    while(n)
    {
        c+=n%10;
        n=n/10;
    }
    if(c==d)
        return true;
    else
        return false;
}

int main()
{
    long long k,d;
    cin>>k>>d;
    //k--;
    long long ans=1;
    /*
     while(k)
     {
         cout<<ans<<endl;1
         ans*=10;
         k--;
     }
     cout<<ans;
      cout<<ans+(d-1);
     if(sumChec(ans+(d-1),d))
         cout<<ans+(d-1);
     else
         cout<<"No solution";
     return 0;
    */

    if(d==0 && k>1)
    {
        cout<<"No solution";
        return 0;
    }

    if(d==0 && k==1)
    {
        cout<<"0";
        return 0;
    }

    if(k>=2)
    {
        cout<<'1';
        while(k-2)
        {
            cout<<'0';
            k--;
        }
        cout<<d-1;
    } else{
        cout<<d;
    }

}


#include<bits/stdc++.h>
using namespace std;

bool sumChec(long long n,long long d)
{
    long long c=0;
    while(n)
    {
        c+=n%10;
        n=n/10;
    }
    return true;
}

int main()
{
    long long k,d;
    cin>>k>>d;
    k--;
    long long ans=1;
    while(k)
    {
        ans*=10;
        k--;
    }
    if(sumChec(ans+(d-1),d))
        cout<<ans+(d-1);
    else
        cout<<"No solution";
            return 0;
}


#include<bits/stdc++.h>
using namespace std;

bool sumChec(long long n,long long d)
{
    long long c=0;
    while(n)
    {
        c+=n%10;
        n=n/10;
    }
    if(c==d)
        return true;
    else
        return false;
}

int main()
{
    long long k,d;
    cin>>k>>d;
    //k--;
    long long ans=1;
   /*
    while(k)
    {
        cout<<ans<<endl;1
        ans*=10;
        k--;
    }
    cout<<ans;
     cout<<ans+(d-1);
    if(sumChec(ans+(d-1),d))
        cout<<ans+(d-1);
    else
        cout<<"No solution";
    return 0;
*/

    if(d==0 && k>1){
        cout<<"No solution";
        return 0;
    }
     if(d==0 && k==1){
        cout<<"0";
        return 0;
    }
    cout<<'1';
    while(k-2){
        cout<<'0';
        k--;
    }
    cout<<d-1;
}


#include<bits/stdc++.h>
using namespace std;

bool sumChec(long long n,long long d)
{
    long long c=0;
    while(n)
    {
        c+=n%10;
        n=n/10;
    }
    if(c==d)
        return true;
    else
        return false;
}

int main()
{
    long long k,d;
    cin>>k>>d;
    k--;
    long long ans=1;
    while(k)
    {
        ans*=10;
        k--;
    }
    if(sumChec(ans+(d-1),d))
        cout<<ans+(d-1);
    else
        cout<<"No solution";
    return 0;
}


# include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define ull unsigned long long

const int N = (int)1e3 + 7;
const int linf = (int)1e9 + 9;
const int mod = (int)1e9 + 7;

ll k, d;

int main(){
  cin >> k >> d;
  if(k > 1 && d == 0){
    cout << "No solution";
    return 0;
  }
  cout << d;
  for(int i = 1; i < k; i++){
    cout << 0;
  }
}


# include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define ull unsigned long long

const int N = (int)1e3 + 7;
const int linf = (int)1e9 + 9;
const int mod = (int)1e9 + 7;

ll S(ll n){
  ll sum = 0;
  ll x = 0;
  while(n > 0){
    x = n % 10;
    sum += x;
    n /= 10;
  }
  return sum;
}

ll calc(ll n){
  if(S(n) < 10)
    return S(n);
  else
    return calc(S(n));
}

ll k, d;

int main(){
  cin >> k >> d;
  ll l = pow(10, k);
  ll r = l;
  l /= 10;
  l--;
  r--;
  for(ll i = l; i <= r; i++){
    if(calc(i) == d){
      cout << i;
      return 0;
    }
  }
  cout << "No solution";
  return 0;
}


# include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define ull unsigned long long

const int N = (int)1e3 + 7;
const int linf = (int)1e9 + 9;
const int mod = (int)1e9 + 7;

int S(int n){
  int sum = 0;
  int x = 0;
  while(n > 0){
    x = n % 10;
    sum += x;
    n /= 10;
  }
  return sum;
}

int calc(int n){
  if(S(n) < 10)
    return S(n);
  else
    return calc(S(n));
}

int k, d;

int main(){
  cin >> k >> d;
  int l = pow(10, k);
  int r = l;
  l /= 10;
  l++;
  r++;
  for(int i = l; i <= r; i++){
    if(calc(i) == d){
      cout << i;
      return 0;
    }
  }
  cout << "No solution";
  return 0;
}


# include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define ull unsigned long long

const int N = (int)1e3 + 7;
const int linf = (int)1e9 + 9;
const int mod = (int)1e9 + 7;

int S(int n){
  int sum = 0;
  int x = 0;
  while(n > 0){
    x = n % 10;
    sum += x;
    n /= 10;
  }
  return sum;
}

int calc(int n){
  if(S(n) < 10)
    return S(n);
  else
    return calc(S(n));
}

int k, d;

int main(){
  cin >> k >> d;
  int l = pow(10, k);
  int r = l;
  l /= 10;
  l--;
  r--;
  for(int i = l; i <= r; i++){
    if(calc(i) == d){
      cout << i;
      return 0;
    }
  }
  cout << "No solution";
  return 0;
}


# include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define ull unsigned long long

const int N = (int)1e3 + 7;
const int linf = (int)1e9 + 9;
const int mod = (int)1e9 + 7;

ll k, d;

ll S(ll n){
  ll sum = 0;
  ll x = 0;
  while(n > 0){
    x = n % 10;
    sum += x;
    n /= 10;
  }
  return sum;
}

int main(){
  cin >> k >> d;
  ll l = 10;
  ll r;
  if(k != 1){
    for(int i = 1; i < k; i++){
      l = l * 1ll * 10;
    }
    r = l;
    l /= 10;
  }
  else{
    l = 0;
    r = 10;
  }
  for(int i = l; i < r; i++){
    if(S(S(S(S(i)))) == d){
      cout << i;
      return 0;
    }
  }
  cout << "No solution";
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
random_device device;
mt19937 mrand(device());
const ll mod=1000000007;
int rnd(int x) { return mrand()%x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// int n=sizeof(arr)/sizeof(arr[0]);
// Ascending Sort sort(arr,arr+n);
// Descending Sort sort(arr, arr+n, greater<int>());
// head
void solve(int t);
int main()
{
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	// cin>>t;
	rep(i,0,t){
	solve(t);
	}
}
void solve(int t)
{
	//Start Here
	ll k,d;
	cin>>k>>d;
	if(k==d){
		rep(i,0,k){
		cout<<"1";}
	} else if(k>d){
		// cout<<"No solution";
		rep(i,0,d){
		cout<<"1";
		}
		rep(i,d,k){
		cout<<"0";
		}
	} else {
		rep(i,0,k-1){
		cout<<"1";
		}
		cout<<d-(k-1);
	}
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
random_device device;
mt19937 mrand(device());
const ll mod=1000000007;
int rnd(int x) { return mrand()%x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// int n=sizeof(arr)/sizeof(arr[0]);
// Ascending Sort sort(arr,arr+n);
// Descending Sort sort(arr, arr+n, greater<int>());
// head
void solve(int t);
int main()
{
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	// cin>>t;
	rep(i,0,t){
	solve(t);
	}
}
void solve(int t)
{
	//Start Here
	ll k,d;
	cin>>k>>d;
	if(k==d){
		rep(i,0,k){
		cout<<"1";}
	} else if(k>d){
		// cout<<"No solution";
		if(d>0){
		rep(i,0,d){
		cout<<"1";
		}
		rep(i,d,k){
		cout<<"0";
		}
	} else {cout<<"No solution";}
	} else {
		rep(i,0,k-1){
		cout<<"1";
		}
		cout<<d-(k-1);
	}
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
random_device device;
mt19937 mrand(device());
const ll mod=1000000007;
int rnd(int x) { return mrand()%x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// int n=sizeof(arr)/sizeof(arr[0]);
// Ascending Sort sort(arr,arr+n);
// Descending Sort sort(arr, arr+n, greater<int>());
// head
void solve(int t);
int main()
{
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	// cin>>t;
	rep(i,0,t){
	solve(t);
	}
}
void solve(int t)
{
	//Start Here
	ll k,d;
	cin>>k>>d;
	if(k==d){
		rep(i,0,k){
		cout<<"1";}
	} else if(k>d){
		// cout<<"No solution";
		if(d>0){
		rep(i,0,d){
		cout<<"1";
		}
		rep(i,d,k){
		cout<<"0";
		}
	} else {cout<<"No solution";}
	} else {
		rep(i,0,k-1){
		cout<<"1";
		}
		cout<<d-(k-1);
	}
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
random_device device;
mt19937 mrand(device());
const ll mod=1000000007;
int rnd(int x) { return mrand()%x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// int n=sizeof(arr)/sizeof(arr[0]);
// Ascending Sort sort(arr,arr+n);
// Descending Sort sort(arr, arr+n, greater<int>());
// head
void solve(int t);
int main()
{
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	// cin>>t;
	rep(i,0,t){
	solve(t);
	}
}
void solve(int t)
{
	//Start Here
	ll k,d;
	cin>>k>>d;
	if(k==d){
		rep(i,0,k){
		cout<<"1";}
	} else if(k>d){
		// cout<<"No solution";
		if(d>0){
		rep(i,0,d){
		cout<<"1";
		}
		rep(i,d,k){
		cout<<"0";
		}
	} else {cout<<"No solution";}
	} else {
		rep(i,0,k-1){
		cout<<"1";
		}
		cout<<d-(k-1);
	}
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
random_device device;
mt19937 mrand(device());
const ll mod=1000000007;
int rnd(int x) { return mrand()%x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// int n=sizeof(arr)/sizeof(arr[0]);
// Ascending Sort sort(arr,arr+n);
// Descending Sort sort(arr, arr+n, greater<int>());
// head
void solve(int t);
int main()
{
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	// cin>>t;
	rep(i,0,t){
	solve(t);
	}
}
void solve(int t)
{
	//Start Here
	ll k,d;
	cin>>k>>d;
	if(k==d){
		rep(i,0,k){
		cout<<"1";}
	} else if(k>d){
		// cout<<"No solution";
		if(d>0 || (d==0 && k==1)){
			rep(i,0,d){
			cout<<"1";
			}
			rep(i,d,k){
			cout<<"0";
			}
		} else {cout<<"No solution";}
	} else {
		rep(i,0,k-1){
		cout<<"1";
		}
		cout<<d-(k-1);
	}
}


#include<iostream>
#include<algorithm>
using namespace std;

int main() {
	unsigned long long int r , s;
	int k , d;
	cin >> k >> d;
	int b[] = {0 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99};
	if(d == 0 && k != 1) {
		cout << "No solution";
		return 0;
	}
	else if(d == 0) {cout << 0 ;
	return 0;
	}
	 r = b[d] % 10;
	 b[d] = b[d] / 10;
	 b[d] = b[d] * pow(10 , k - 1);
	 s = b[d] + r;
	 cout << s;

}


#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#define MOD 1000000007
 using namespace std;
int main() {
	 long long int r , s;
	int k , d;
	cin >> k >> d;
	int b[] = {0 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99};
	if(d == 0 && k != 1) {
		cout << "No solution";
		return 0;
	}
	else if(d == 0) {cout << 0 ;
	return 0;
	}
	else if(k == 1) {
		cout << d;
		return 0;
	}
	 r = b[d] % 10;
	 b[d] = b[d] / 10;
     cout << b[d];
     for(int i = 0 ; i < k - 2 ;i++) {
     	cout << 0;
	 }
	 cout << r;

}


#include<iostream>
#include<algorithm>
using namespace std;

int main() {
	unsigned long long int k , d , r , s;
	cin >> k >> d;
	int b[] = {0 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99};
	if(d == 0 && k != 1) {
		cout << "No solution";
		return 0;
	}
	else if(d == 0) {cout << 0 ;
	return 0;
	}
	 r = b[d] % 10;
	 b[d] = b[d] / 10;
	 b[d] = b[d] * pow(10 , k - 1);
	 s = b[d] + r;
	 cout << s;

}


#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#define MOD 1000000007
 using namespace std;
int main() {
	 long long int r , s;
	int k , d;
	cin >> k >> d;
	int b[] = {0 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99};
	if(d == 0 && k != 1) {
		cout << "No solution";
		return 0;
	}
	else if(d == 0) {cout << 0 ;
	return 0;
	}
	 r = b[d] % 10;
	 b[d] = b[d] / 10;
     cout << b[d];
     for(int i = 0 ; i < k - 2 ;i++) {
     	cout << 0;
	 }
	 cout << r;

}


#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

int main() {
	unsigned long long int r , s;
	int k , d;
	cin >> k >> d;
	int b[] = {0 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99};
	if(d == 0 && k != 1) {
		cout << "No solution";
		return 0;
	}
	else if(d == 0) {cout << 0 ;
	return 0;
	}
	 r = b[d] % 10;
	 b[d] = b[d] / 10;
	 b[d] = b[d] * pow(10 , k - 1);
	 s = b[d] + r;
	 cout << s;

}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n
#define f(i, n) for (int i = 0; i < int(n); i++)
#define g(i, n) for (int i = 0; i < int(n-1); i++)
#define fj(j, n) for (int j = 0; j < int(n); j++)
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

// Driver function to sort the vector elements by
// second element of pair in descending order
bool sortbysecdesc(const pair<int,int> &a,
                   const pair<int,int> &b)
{
       return a.second>b.second;
}

// Driver function to sort the vector elements by
// first element of pair in descending order
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

// Function to return gcd of a and b
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

//Function to return lcm of a and b
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}

// Function to find gcd of array of
// numbers
int findGCD(ll a[], ll n)
{
    int result = a[0];
    for (int i = 1; i < n; i++)
    {
        result = gcd(a[i], result);

        if(result == 1)
        {
           return 1;
        }
    }
    return result;
}

int32_t main() {
    fio;

    ll k,d;
    cin>>k>>d;
    if(k==1 && d==0)
    cout<<0<<endl;
    else if(k==0 && d!=1)
    cout<<"No solution"<<endl;
    else
    cout<<k*pow(10,k-1)<<endl;

    return 0 ;

}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n
#define f(i, n) for (int i = 0; i < int(n); i++)
#define g(i, n) for (int i = 0; i < int(n-1); i++)
#define fj(j, n) for (int j = 0; j < int(n); j++)
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

// Driver function to sort the vector elements by
// second element of pair in descending order
bool sortbysecdesc(const pair<int,int> &a,
                   const pair<int,int> &b)
{
       return a.second>b.second;
}

// Driver function to sort the vector elements by
// first element of pair in descending order
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

// Function to return gcd of a and b
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

//Function to return lcm of a and b
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}

// Function to find gcd of array of
// numbers
int findGCD(ll a[], ll n)
{
    int result = a[0];
    for (int i = 1; i < n; i++)
    {
        result = gcd(a[i], result);

        if(result == 1)
        {
           return 1;
        }
    }
    return result;
}

int32_t main() {
    fio;

    ll k,d;
    cin>>k>>d;
    if(k==1 && d==0)
    cout<<0<<endl;
    else if(k!=0 && d==0)
    cout<<"No solution"<<endl;
    else
    {
        cout<<d;
        f(i,k-1)
        cout<<0;
    }

    return 0 ;

}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n
#define f(i, n) for (int i = 0; i < int(n); i++)
#define g(i, n) for (int i = 0; i < int(n-1); i++)
#define fj(j, n) for (int j = 0; j < int(n); j++)
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

// Driver function to sort the vector elements by
// second element of pair in descending order
bool sortbysecdesc(const pair<int,int> &a,
                   const pair<int,int> &b)
{
       return a.second>b.second;
}

// Driver function to sort the vector elements by
// first element of pair in descending order
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

// Function to return gcd of a and b
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

//Function to return lcm of a and b
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}

// Function to find gcd of array of
// numbers
int findGCD(ll a[], ll n)
{
    int result = a[0];
    for (int i = 1; i < n; i++)
    {
        result = gcd(a[i], result);

        if(result == 1)
        {
           return 1;
        }
    }
    return result;
}

int32_t main() {
    fio;

    ll k,d;
    cin>>k>>d;
    if(k==1 && d==0)
    cout<<0<<endl;
    else if(k!=0 && d==0)
    cout<<"No solution"<<endl;
    else
    cout<<d*pow(10,k-1)<<endl;

    return 0 ;

}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n
#define f(i, n) for (int i = 0; i < int(n); i++)
#define g(i, n) for (int i = 0; i < int(n-1); i++)
#define fj(j, n) for (int j = 0; j < int(n); j++)
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

// Driver function to sort the vector elements by
// second element of pair in descending order
bool sortbysecdesc(const pair<int,int> &a,
                   const pair<int,int> &b)
{
       return a.second>b.second;
}

// Driver function to sort the vector elements by
// first element of pair in descending order
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

// Function to return gcd of a and b
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

//Function to return lcm of a and b
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}

// Function to find gcd of array of
// numbers
int findGCD(ll a[], ll n)
{
    int result = a[0];
    for (int i = 1; i < n; i++)
    {
        result = gcd(a[i], result);

        if(result == 1)
        {
           return 1;
        }
    }
    return result;
}

int32_t main() {
    fio;

    ll k,d;
    cin>>k>>d;
    if(k==1 && d==0)
    cout<<0<<endl;
    else if(k==0 && d!=1)
    cout<<"No solution"<<endl;
    else
    cout<<d*pow(10,k-1)<<endl;

    return 0 ;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int k,d;
    cin>>k>>d;
    if(d==0)
    {
        if(k==1)
         {
             cout<<"0"<<endl;
             return 0;
         }

        cout<<"No solution"<<endl;
        return 0;
    }
    else
    {
        string res="";
        char ch=d+48;
        res=res+ch;
        for(int i=0;i<k-1;i++)
        {
         res=res+"0";
        }
        cout<<res<<endl;
        return 0;
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int k,d;
    cin>>k>>d;
    if(d==0)
    {
        if(k==1)
         {
             cout<<"0"<<endl;
             return 0;
         }

        cout<<"No solution"<<endl;
        return 0;
    }
    else
    {
        string res="d";
        for(int i=0;i<k-1;i++)
        {
            d=d+"0";
        }
        cout<<res<<endl;
        return 0;
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int k,d;
    if(d==0)
    {
        if(k==1)
         {
             cout<<"0"<<endl;
             return 0;
         }

        cout<<"NO SOLUTION"<<endl;
        return 0;
    }
    else
    {
        long long res=k;
        for(int i=0;i<k-1;i++)
        {
            res=res*10;
        }
        cout<<res<<endl;
        return 0;
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int k,d;
    cin>>k>>d;
    if(d==0)
    {
        if(k==1)
         {
             cout<<"0"<<endl;
             return 0;
         }

        cout<<"No solution"<<endl;
        return 0;
    }
    else
    {
        long long res=d;
        for(int i=0;i<k-1;i++)
        {
            res=res*10;
        }
        cout<<res<<endl;
        return 0;
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int k,d;
    cin>>k>>d;
    if(d==0)
    {
        if(k==1)
         {
             cout<<"0"<<endl;
             return 0;
         }

        cout<<"NO SOLUTION"<<endl;
        return 0;
    }
    else
    {
        long long res=d;
        for(int i=0;i<k-1;i++)
        {
            res=res*10;
        }
        cout<<res<<endl;
        return 0;
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int k,d;
    cin>>k>>d;
    if(d==0)
    {
        if(k==1)
         {
             cout<<"0"<<endl;
             return 0;
         }

        cout<<"No solution"<<endl;
        return 0;
    }
    else
    {
        string res="d";
        for(int i=0;i<k-1;i++)
        {
         res=res+"0";
        }
        cout<<res<<endl;
        return 0;
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int k,d;
    cin>>k>>d;
    if(d==0)
    {
        if(k==1)
         {
             cout<<"0"<<endl;
             return 0;
         }

        cout<<"NO SOLUTION"<<endl;
        return 0;
    }
    else
    {
        long long res=k;
        for(int i=0;i<k-1;i++)
        {
            res=res*10;
        }
        cout<<res<<endl;
        return 0;
    }
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,e,b,cnt;
int arr[N];
int main()
{
    cin>>n>>b;

     if (b==0&&n==1)

        return cout<<0, 0 ;

          if (b==0)
        return cout<<"No solution", 0 ;
        e=n;
        while(n)
        {

           cnt +=(n%10);
           n/=10;
        }

    for(int i =0 ; i<e-1 ; i++ )
        {
            cout<<1;
        }
        if (cnt==b)
            cout<<1;

            else if(b>cnt)
        cout<<(b-cnt);
        else if(b<cnt)
         cout<<(9-cnt+b);

        }


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,a=1,b;
int arr[N];
int main()
{
    cin>>n>>b;

     if (b==0)
        return cout<<0 , 0 ;
    for(int i =1 ; i<n ; i++ )
        {
            a*=10;
            a++;
        }
        if (b==n)
            cout<<a;

            else if(b>n)
        cout<<a+(b-n);
        else if(b<n)
         cout<<a+(9-n+b);

        }


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,a=1,b;
int arr[N];
int main()
{
    cin>>n>>b;

     if (b==0&&n==1)

        return cout<<0, 0 ;

          if (b==0)
        return cout<<"No solution", 0 ;

    for(int i =1 ; i<n ; i++ )
        {
            a*=10;
            a++;
        }
        if (b==n)
            cout<<a;

            else if(b>n)
        cout<<a+(b-n);
        else if(b<n)
         cout<<a+(9-n+b);

        }


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,e,b,cnt;
int arr[N];
int main()
{
    cin>>n>>b;

     if (b==0&&n==1)

        return cout<<0, 0 ;

          if (b==0)
        return cout<<"No solution", 0 ;
        e=n;
        while(n)
        {

           cnt +=(n%10);
           n/=10;
        }

    for(int i =0 ; i<e-1 ; i++ )
        {
            cout<<1;
        }
        if (cnt==b)
            cout<<1;

            else if(b>cnt)
        cout<<(b-cnt+1);
        else if(b<cnt)
         cout<<(9-cnt+b+1);

        }


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="return" />
		<Option pch_mode="2" />
		<Option compiler="gcc" />
		<Build>
			<Target title="Debug">
				<Option output="bin/Debug/return" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Debug/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-g" />
				</Compiler>
			</Target>
			<Target title="Release">
				<Option output="bin/Release/return" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-O2" />
				</Compiler>
				<Linker>
					<Add option="-s" />
				</Linker>
			</Target>
		</Build>
		<Compiler>
			<Add option="-Wall" />
			<Add option="-fexceptions" />
		</Compiler>
		<Unit filename="main.cpp" />
		<Extensions>
			<code_completion />
			<envvars />
			<debugger />
		</Extensions>
	</Project>
</CodeBlocks_project_file>


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,a=1,b;
int arr[N];
int main()
{
    cin>>n>>b;

     if (b==0&&n==1)

        return cout<<"No solution", 0 ;

          if (b==0)
        return  0 ;

    for(int i =1 ; i<n ; i++ )
        {
            a*=10;
            a++;
        }
        if (b==n)
            cout<<a;

            else if(b>n)
        cout<<a+(b-n);
        else if(b<n)
         cout<<a+(9-n+b);

        }


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,e,b,cnt;
int arr[N];

int onedigit(int n )
{
    cnt=0;
    while(n)
    {

        cnt +=(n%10);
        n/=10;
    }
    return cnt;
}
int main()
{
    cin>>n>>b;
    if (b==0&&n==1)

        return cout<<0, 0 ;

    if (b==0)
        return cout<<"No solution", 0 ;

    int r=onedigit(n);
    int t=onedigit(r);
    for(int i =0 ; i<n-1 ; i++ )
    {
        cout<<1;
    }
    if (t==b)
        cout<<1;

    else if(b>t)
        cout<<(b-t+1);
    else if(b<t)
        cout<<(9-t+b+1);

}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,a=1,b;
int arr[N];
int main()
{
    cin>>n>>b;

     if (b==0)
     {
         for(int i =1 ; i<n ; i++ )
        cout<<0;
        return cout<<0 , 0 ;
     }
    for(int i =1 ; i<n ; i++ )
        {
            a*=10;
            a++;
        }
        if (b==n)
            cout<<a;

            else if(b>n)
        cout<<a+(b-n);
        else if(b<n)
         cout<<a+(9-n+b);

        }


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,a=1,b;
int arr[N];
int main()
{
    cin>>n>>b;

     if (b==0&&n==1)

        return cout<<0 , 0 ;

          if (b==0)
        return  0 ;

    for(int i =1 ; i<n ; i++ )
        {
            a*=10;
            a++;
        }
        if (b==n)
            cout<<a;

            else if(b>n)
        cout<<a+(b-n);
        else if(b<n)
         cout<<a+(9-n+b);

        }


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,a=1,b;
int arr[N];
int main()
{
    cin>>n>>b;

     if (b==0)
        return cout<<0 , 0 ;
    for(int i =1 ; i<n ; i++ )
        {
            a*=10;
            a++;
        }
        if (b==n)
            cout<<a;

            else if(b>n)
        cout<<a+(b-n)<<" ";
        else if(b<n)
         cout<<a+(9-n+b)<<" ";

        }


#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define ll long long
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
int main()
{
	FAST
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ll k,d;
	cin >> k >> d;
	if(d==0)
	{
		if(k==1)
			cout<<"0";
		else
			cout<<"No Solution";
	}
	else
		cout<<(unsigned long long int)d*pow(10,k-1);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[1005];
ll n,k;
int main()
{
    cin >> n >> k;
    if(k==0 && n>1)
    {
        cout<<"No solution";
        return 0;
    }
    cout<<k;
    for(int i=0;i<n-1;i++)cout<<0;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[1005];
ll n,k;
int main()
{
    cin >> n >> k;
    if(k==0 && n>1)
    {
        cout<<"No Solution";
        return 0;
    }
    cout<<k;
    for(int i=0;i<n-1;i++)cout<<0;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[1005];
ll n,k;
int main()
{
    cin >> n >> k;
    if(k==0)
    {
        cout<<"No Solution";
        return 0;
    }
    cout<<k;
    for(int i=0;i<n-1;i++)cout<<0;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[1005];
ll n,k;
int main()
{
    cin >> n >> k;
    cout<<k;
    for(int i=0;i<n-1;i++)cout<<0;
    return 0;
}


#include <iostream>
using namespace std;

int main() {
int k,d;
cin>>k>>d;
cout<<d;
if(d>=k)	{for(int i=0;i<k-1;i++)	cout<<0;}
else if(d=0)	{if(k=1)	cout<<0;
		else cout<<"No solution";}
else	{cout<<9;	for(int i=0;i<k-2;i++)	cout<<0;}
return 0;
}


#include <iostream>
using namespace std;

int main() {#include <iostream>
using namespace std;

int main() {
int k,d;
cin>>k>>d;
cout<<d;
if(d>=k)	{for(int i=0;i<k-1;i++)	cout<<0;}
else if(d==0)	{if(k=1)	cout<<0;
		else cout<<"No solution";}
else	{cout<<9;	for(int i=0;i<k-2;i++)	cout<<0;}
return 0;
}
return 0;
}


 #include <iostream>
using namespace std;
int main() {
int k,d;
cin>>k>>d;
cout<<d;
if(d>=k)	{for(int i=0;i<k-1;i++)	cout<<0;}
else if(d==0)	{if(k==1)	break;
		else cout<<"No solution";}
else	{cout<<9;	for(int i=0;i<k-2;i++)	cout<<0;}
return 0;
}


 #include <iostream>
using namespace std;
int main() {
int k,d;
cin>>k>>d;
cout<<d;
if(d>=k)	{for(int i=0;i<k-1;i++)	cout<<0;}
else if(d==0&&k!=1)	 cout<<"No solution";
else	{cout<<9;	for(int i=0;i<k-2;i++)	cout<<0;}
return 0;
}


 #include <iostream>
using namespace std;
int main() {
int k,d;
cin>>k>>d;
if(d==0&&k!=1)	 {cout<<"No solution";	return 0;}
cout<<d;
if(d==0&&k==1)		return 0;
if(d>=k)	{for(int i=0;i<k-1;i++)	cout<<0;}
else	{cout<<9;	for(int i=0;i<k-2;i++)	cout<<0;}
return 0;
}


 #include <iostream>
using namespace std;
int main() {
int k,d;
cin>>k>>d;
cout<<d;
if(d>=k)	{for(int i=0;i<k-1;i++)	cout<<0;}
else if(d==0)	 {if(k!=1)	cout<<"No solution";
		else	return 0;}
else	{cout<<9;	for(int i=0;i<k-2;i++)	cout<<0;}
return 0;
}


int main() {#include <iostream>
using namespace std;

int main() {
int k,d;
cin>>k>>d;
cout<<d;
if(d>=k)	{for(int i=0;i<k-1;i++)	cout<<0;}
else if(d==0)	{if(k=1)	cout<<0;
		else cout<<"No solution";}
else	{cout<<9;	for(int i=0;i<k-2;i++)	cout<<0;}
return 0;}


 #include <iostream>
using namespace std;
int main() {
int k,d;
cin>>k>>d;
cout<<d;
if(d>=k)	{for(int i=0;i<k-1;i++)	cout<<0;}
else if(d==0)	{if(k==1)	cout<<0;
		else cout<<"No solution";}
else	{cout<<9;	for(int i=0;i<k-2;i++)	cout<<0;}
return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long int
#define REP(i, a, b) for(int i = a; i < b; i++)

int main()
{
    IOS;
    int n, k;
    cin >> n >> k;
    if (k != 0)
        cout << k * (int)pow(10, n - 1) << endl;
    else
        cout << 0 << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long int
#define REP(i, a, b) for(int i = a; i < b; i++)

int main()
{
    IOS;
    int n, k;
    cin >> n >> k;

    cout << k * (int)pow(10, n - 1) << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long int
#define REP(i, a, b) for(int i = a; i < b; i++)

int main()
{
    IOS;
    int n, k;
    cin >> n >> k;
    if (k != 0) {
        cout << k;
        for (int i = 0; i < n - 1; i++)
            cout << 0;
        cout << endl;
    }
    else {
        if (n == 1)
            cout << 0 << endl;
        else
            cout << "No solution" << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long int
#define REP(i, a, b) for(int i = a; i < b; i++)

int main()
{
    IOS;
    int n, k;
    cin >> n >> k;
    if (k != 0)
        cout << k * (int)pow(10, n - 1) << endl;
    else {
        if (n == 1)
            cout << 0 << endl;
        else
            cout << "No solution" << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long int
#define REP(i, a, b) for(int i = a; i < b; i++)

int main()
{
    IOS;
    int n, k;
    cin >> n >> k;
    if (k != 0)
        cout << k * (int)pow(10, n - 1) << endl;
    else {
        if (n == 1)
            cout << 0 << endl;
        else
            cout << "No Solution" << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <numeric>
#define int long long
#define what_is(x) cerr << #x << " is " << x << endl;
const int MOD = 1e9 + 7;
using namespace std;
int powmod(int a, int b, int MOD = MOD){
    if(!a and !b)    return 1ll;
    if(!a)    return a;
    int res = 1ll;
    b %= (MOD - 1ll), a %= MOD;
    while(b){
        if(b%2 == 1)    res = (res * a) % MOD;
        a = (a * a) % MOD;
        b /= 2;
    }
    return res;
}
//int solve(int x)
//{
//    int sum=0;
//    while(x)
//    {
//        sum+=x%10;
//        x/=10;
//    }
//
//    if(sum>=10)
//    {
//        return solve(sum);
//    }
//    else return sum;
//}
void panda() {
    int k,d;
    cin>>k>>d;
    if(k==1 and d==9) {
        cout<<9;
        return;
    }
    if(k>1 and d==0)
    {
        cout<<"No solution";
        return;
    }
    k--;
    while(k)
    {
        cout<<9;
        k--;
    }
    if(d==9)
        cout<<0;
    else
        cout<<d;
//    int num=0;
//    while(k--)
//    {
//        num=num*10+9;
//    }
//    what_is(num);
//    while(num--)
//    {
//        if(solve(num)==d)
//        {
//            cout<<num;
//            return;
//        }
//    }
//    cout<<"No solution";
}

int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
//    int t;
//    cin>>t;
//    while(t--)
    panda();
}


#include<bits/stdc++.h>
#include <numeric>
#define int long long
#define what_is(x) cerr << #x << " is " << x << endl;
const int MOD = 1e9 + 7;
using namespace std;
int powmod(int a, int b, int MOD = MOD){
    if(!a and !b)    return 1ll;
    if(!a)    return a;
    int res = 1ll;
    b %= (MOD - 1ll), a %= MOD;
    while(b){
        if(b%2 == 1)    res = (res * a) % MOD;
        a = (a * a) % MOD;
        b /= 2;
    }
    return res;
}
//int solve(int x)
//{
//    int sum=0;
//    while(x)
//    {
//        sum+=x%10;
//        x/=10;
//    }
//
//    if(sum>=10)
//    {
//        return solve(sum);
//    }
//    else return sum;
//}
void panda() {
    int k,d;
    cin>>k>>d;
    if(k==1 and d==9) {
        cout<<9;
        return;
    }
    k--;
    while(k)
    {
        cout<<9;
        k--;
    }
    if(d==9)
        cout<<0;
    else
        cout<<d;
//    int num=0;
//    while(k--)
//    {
//        num=num*10+9;
//    }
//    what_is(num);
//    while(num--)
//    {
//        if(solve(num)==d)
//        {
//            cout<<num;
//            return;
//        }
//    }
//    cout<<"No solution";
}

int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
//    int t;
//    cin>>t;
//    while(t--)
    panda();
}


#include<bits/stdc++.h>
#include <numeric>
#define int long long
#define what_is(x) cerr << #x << " is " << x << endl;
const int MOD = 1e9 + 7;
using namespace std;
int powmod(int a, int b, int MOD = MOD){
    if(!a and !b)    return 1ll;
    if(!a)    return a;
    int res = 1ll;
    b %= (MOD - 1ll), a %= MOD;
    while(b){
        if(b%2 == 1)    res = (res * a) % MOD;
        a = (a * a) % MOD;
        b /= 2;
    }
    return res;
}
int solve(int x)
{
    int sum=0;
    while(x)
    {
        sum+=x%10;
        x/=10;
    }

    if(sum>=10)
    {
        return solve(sum);
    }
    else return sum;
}
void panda() {
    int k,d;
    cin>>k>>d;
    int num=0;
    while(k--)
    {
        num=num*10+9;
    }
    while(num--)
    {
        if(solve(num)==d)
        {
            cout<<num;
            return;
        }
    }
    cout<<"No solution";
}

int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
//    int t;
//    cin>>t;
//    while(t--)
    panda();
}


#include<bits/stdc++.h>
#include <numeric>
#define int long long
#define what_is(x) cerr << #x << " is " << x << endl;
const int MOD = 1e9 + 7;
using namespace std;
int powmod(int a, int b, int MOD = MOD){
    if(!a and !b)    return 1ll;
    if(!a)    return a;
    int res = 1ll;
    b %= (MOD - 1ll), a %= MOD;
    while(b){
        if(b%2 == 1)    res = (res * a) % MOD;
        a = (a * a) % MOD;
        b /= 2;
    }
    return res;
}
//int solve(int x)
//{
//    int sum=0;
//    while(x)
//    {
//        sum+=x%10;
//        x/=10;
//    }
//
//    if(sum>=10)
//    {
//        return solve(sum);
//    }
//    else return sum;
//}
void panda() {
    int k,d;
    cin>>k>>d;
    k--;
    while(k)
    {
        cout<<9;
        k--;
    }
    if(d==9)
        cout<<0;
    else
        cout<<d;
//    int num=0;
//    while(k--)
//    {
//        num=num*10+9;
//    }
//    what_is(num);
//    while(num--)
//    {
//        if(solve(num)==d)
//        {
//            cout<<num;
//            return;
//        }
//    }
//    cout<<"No solution";
}

int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
//    int t;
//    cin>>t;
//    while(t--)
    panda();
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string k,d;
    cin>>k>>d;
    if(d=='0')
    cout<<d<<"\n";
    else
    {
        for(int i=1;i<k;i++)
        k+='0';
        cout<<k<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int k,d;
    cin>>k>>d;
    if(d==0)
    {   if(k==1)
        cout<<d<<"\n";
        else
        cout<<"No solution\n";
    }
    else
    {
        cout<<d;
        for(int i=1;i<k;i++)
        cout<<"0";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int k,d;
    cin>>k>>d;
    if(d==0)
    cout<<d<<"\n";
    else
    {
        cout<<d;
        for(int i=1;i<k;i++)
        cout<<"0";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string k,d;
    cin>>k>>d;
    if(d=="0")
    cout<<d<<"\n";
    else
    {
        for(int i=1;i<k;i++)
        k+='0';
        cout<<k<<"\n";
    }
    return 0;
}