#include <cstdio>
#include <cstdlib>
#include <algorithm>
#define int64 long long
const int inf = (int) 1e9 + 10;
using namespace std;

typedef int arr32[200010];

arr32 q, c, next, g, st, et, e, slf, in, t;
int64 d1[200010], d2[200010];
int n, ap, Y;

void link(int x, int y, int s, int t)  {
	c[++ap] = y, next[ap] = g[x], g[x] = ap;
	st[ap] = s, et[ap] = t, e[ap] = s;
}
void spfa(int st, int64 *d)  {
	for (int i = 1; i <= n; ++i)  d[i] = inf;

	int tA = st;  slf[st] = d[st] = 0;  t[st] = ++Y, in[st] = 1;
	for (int z = st; z; in[z] = 0, z = slf[z])
		for (int x = g[z]; x; x = next[x])
			if (t[c[x]] < Y  ||  d[c[x]] > d[z] + e[x])
				if (d[c[x]] = d[z] + e[x], t[c[x]] = Y, !in[c[x]])
					if (in[c[x]] = 1, tA != z  &&  d[slf[z]] > d[c[x]])
						slf[c[x]] = slf[z], slf[z] = c[x];
					else  slf[c[x]] = 0, tA = slf[tA] = c[x];
}
bool error_edge()  {
	for (int i = 1; i <= n; ++i)
		for (int x = g[i]; x; x = next[x])
			if (st[x] != et[x])
				if (d1[i] <= d2[i]  &&  e[x] != st[x])
				  return 1;
				else  if (d1[i] > d2[i]  &&  e[x] != et[x])
					return 1;
	return 0;
}
int main()  {
	//freopen("E.in", "r", stdin);
	//freopen("E.out", "w", stdout);

	int m, k, s1, s2, f, x, y, z, ace;

	scanf("%d %d %d %d %d %d", &n, &m, &k, &s1, &s2, &f);
	for (int i = 1; i <= m; ++i)  {
		scanf("%d %d %d", &x, &y, &z);
		link(x, y, z, z);
	}
	for (int i = 1; i <= k; ++i)  {
		scanf("%d %d %d %d", &x, &y, &z, &ace);
		link(x, y, z, ace);  q[i] = ap;
	}
	while (spfa(s1, d1), spfa(s2, d2), error_edge())  {
		for (int i = 1; i <= n; ++i)
			for (int x = g[i]; x; x = next[x])
				if (st[x] != et[x])
					if (d1[i] <= d2[i]  &&  e[x] != st[x])
						e[x] = st[x];
					else  if (d1[i] > d2[i]  &&  e[x] != et[x])
						e[x] = et[x];
	}

	if (d1[f] <= d2[f])  {
		if (d1[f] < d2[f])  printf("WIN\n");
		else  printf("DRAW\n");
		for (int i = 1; i <= k; ++i)
			printf("%d ", e[q[i]]);
	}
	else  printf("LOSE\n");
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<vector>
#include<string>
#define N 10005
#define INF (1 << 29)
using namespace std;
int a,b,c,d,e,f,g,h,i,j,k;
struct node
{
    int v,w;
    int next;
};
node GG[N << 1];
int end[N << 1];
int tot;

int L[N];
int X[N];
int E[10];

int D[3][N];
int que[N << 2],l,r;
bool v[N];

int F[N];

void Add_Edge(int u,int v,int w)
{
    GG[++tot].v = v;GG[tot].w = w;
    GG[tot].next = end[u];end[u] = tot;
}

void Spfa(int source,int DD[])
{
    int ii,jj,kk;
    for(ii = 1; ii <= a; ii ++) DD[ii] = INF;
    DD[source] = 0;
    que[1] = source;
    v[source] = true;
    l = 0; r = 1;
    while(l < r)
    {
        l ++;
        jj = end[que[l]];
        while(jj)
        {
            if(DD[que[l]] + GG[jj].w < DD[GG[jj].v])
            {
                DD[GG[jj].v] = DD[que[l]] + GG[jj].w;
                if(v[GG[jj].v] == false)
                {
                    que[++r] = GG[jj].v;
                    v[GG[jj].v] = true;
                }
            }
            jj = GG[jj].next;
        }
        v[que[l]] = false;
    }
}
void Work()
{
    Spfa(E[1], D[1]);
    Spfa(E[2], D[2]);
}
void Get()
{
    int ii,jj,kk;
    bool hav;
    while(true)
    {
        hav = false;
        for(ii = 1; ii <= k; ii ++)
        if(D[1][X[ii]] < D[2][X[ii]] && F[ii] != L[ii])
        {
            hav = true;
            GG[b + ii].w = L[ii];
            F[ii] = L[ii];
        }
        Work();
        if(hav == false) break;
    }
    string an;
    if(D[1][E[0]] < D[2][E[0]]) an = "WIN";
    else if(D[1][E[0]] == D[2][E[0]]) an = "DRAW";
    else an = "LOSE";
    cout << an << endl;
    if(an != "LOSE")
    {
        for(ii = 1; ii <= k ;ii ++)
            cout << F[ii] << " ";
        cout << endl;
    }
}

int main()
{
    cin >> a >> b >> k;
    cin >> E[1] >> E[2] >> E[0];
    for(i = 1; i <= b; i ++)
    {
        cin >> c >> d >> e;
        Add_Edge(c, d, e);
    }
    for(i = 1; i <= k; i ++)
    {
        cin >> c >> d >> L[i] >> e;
        Add_Edge(c, d, e);
        X[i] = c;
        F[i] = e;
    }
    Work();
    Get();
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<vector>
#include<string>
#define N 10005
#define INF (1LL << 61)
using namespace std;
typedef long long LL;
LL a,b,c,d,e,f,g,h,i,j,k;
struct node
{
    LL v,w;
    LL next;
};
node GG[N << 1];
LL end[N << 1];
LL tot;

LL L[N];
LL X[N];
LL E[10];

LL D[3][N];
LL que[N << 2],l,r;
bool v[N];

LL F[N];

void Add_Edge(LL u,LL v,LL w)
{
    GG[++tot].v = v;GG[tot].w = w;
    GG[tot].next = end[u];end[u] = tot;
}

void Spfa(LL source,LL DD[])
{
    LL ii,jj,kk;
    for(ii = 1; ii <= a; ii ++) DD[ii] = INF;
    DD[source] = 0;
    que[1] = source;
    v[source] = true;
    l = 0; r = 1;
    while(l < r)
    {
        l ++;
        jj = end[que[l]];
        while(jj)
        {
            if(DD[que[l]] + GG[jj].w < DD[GG[jj].v])
            {
                DD[GG[jj].v] = DD[que[l]] + GG[jj].w;
                if(v[GG[jj].v] == false)
                {
                    que[++r] = GG[jj].v;
                    v[GG[jj].v] = true;
                }
            }
            jj = GG[jj].next;
        }
        v[que[l]] = false;
    }
}
void Work()
{
    Spfa(E[1], D[1]);
    Spfa(E[2], D[2]);
}
void Get()
{
    LL ii,jj,kk;
    bool hav;
    while(true)
    {
        hav = false;
        for(ii = 1; ii <= k; ii ++)
        if(D[1][X[ii]] < D[2][X[ii]] && F[ii] != L[ii])
        {
            hav = true;
            GG[b + ii].w = L[ii];
            F[ii] = L[ii];
        }
        Work();
        if(hav == false) break;
    }
    string an;
    if(D[1][E[0]] < D[2][E[0]]) an = "WIN";
    else if(D[1][E[0]] == D[2][E[0]]) an = "DRAW";
    else an = "LOSE";
    cout << an << endl;
    if(an != "LOSE")
    {
        for(ii = 1; ii <= k ;ii ++)
            cout << F[ii] << " ";
        cout << endl;
    }
}

int main()
{
    cin >> a >> b >> k;
    cin >> E[1] >> E[2] >> E[0];
    for(i = 1; i <= b; i ++)
    {
        cin >> c >> d >> e;
        Add_Edge(c, d, e);
    }
    for(i = 1; i <= k; i ++)
    {
        cin >> c >> d >> L[i] >> e;
        Add_Edge(c, d, e);
        X[i] = c;
        F[i] = e;
    }
    Work();
    Get();
    return 0;
}


#include <cstdio>
const int N=(int)1e4+5,M=N,K=105;
typedef long long ll;
const ll inf=1e18;
int getint(){
	char c;
	while((c=getchar())<'0'||c>'9'); int a=c-'0';
	while((c=getchar())>='0'&&c<='9') a=a*10+(c-'0');
	return a;
}
int n,m,k;
struct node;
struct edge{
	node *ed;
	edge *next;
	int w;
} E[M+K],*newE=E,*seq;
int a[K],b[K],l[K],r[K];
struct node{
	edge *son;
	ll dist[2];
	bool inq;
} V[N],*s[2],*t;
int head,tail;
node *q[N];
void spfa(int f,node *s){
	head=tail=0;
	s->inq=true;
	q[tail++]=s;
	while(head!=tail){
		node *u=q[head]; if(++head==N) head=0;
		u->inq=false;
		for(edge *e=u->son;e;e=e->next){
			node *v=e->ed;
			if(u->dist[f]+e->w<v->dist[f]){
				v->dist[f]=u->dist[f]+e->w;
				if(!v->inq){
					v->inq=true;
					q[tail]=v;
					if(++tail==N) tail=0;
				}
			}
		}
	}
}
void renew(node *u){
	spfa(0,u);
	spfa(1,u);
}
bool work0(){
	bool moved=true;
	while(moved){
		moved=false;
		for(int i=0;i<k;i++) if(V[a[i]].dist[0]<V[a[i]].dist[1]&&seq[i].w!=l[i]){
			seq[i].w=l[i];
			renew(V+a[i]);
			moved=true;
		}
	}
	return t->dist[0]<t->dist[1];
}
bool work1(){
	bool moved=true;
	while(moved){
		moved=false;
		for(int i=0;i<k;i++) if(V[a[i]].dist[0]<=V[a[i]].dist[1]&&seq[i].w!=l[i]){
			seq[i].w=l[i];
			renew(V+a[i]);
			moved=true;
		}
	}
	return t->dist[0]<=t->dist[1];
}
int main(){
	n=getint(),m=getint(),k=getint();
	s[0]=V+getint(),s[1]=V+getint(),t=V+getint();
	for(int i=0;i<m;i++){
		int a=getint(),b=getint(),c=getint();
		*newE=(edge){V+b,V[a].son,c},V[a].son=newE++;
	}
	seq=newE;
	for(int i=0;i<k;i++){
		a[i]=getint(),b[i]=getint();
		l[i]=getint(),r[i]=getint();
		*newE=(edge){V+b[i],V[a[i]].son,r[i]},V[a[i]].son=newE++;
	}
	for(int i=0;i<k;i++) seq[i].w=r[i];
	for(int i=1;i<=n;i++) V[i].dist[0]=V[i].dist[1]=inf;
	s[0]->dist[0]=0;
	renew(s[0]);
	s[1]->dist[1]=0;
	renew(s[1]);
	if(work0()){
		puts("WIN");
		for(int i=0;i<k;i++) printf("%d ",seq[i].w);
	}
	else
	if(work1()){
		puts("DRAW");
		for(int i=0;i<k;i++) printf("%d ",seq[i].w);
	}
	else
		puts("LOSE");
}


#include <cstdio>
const int N=(int)1e4+5,M=N,K=105;
typedef long long ll;
const ll inf=1e18;
int getint(){
	char c;
	while((c=getchar())<'0'||c>'9'); int a=c-'0';
	while((c=getchar())>='0'&&c<='9') a=a*10+(c-'0');
	return a;
}
int n,m,k;
struct node;
struct edge{
	node *ed;
	edge *next;
	int w;
} E[M+K],*newE=E,*seq;
int a[K],b[K],l[K],r[K];
struct node{
	edge *son;
	ll dist[2];
	bool inq;
} V[N],*s[2],*t;
int head,tail;
node *q[N];
void spfa(int f,node *s){
	head=tail=0;
	s->inq=true;
	q[tail++]=s;
	while(head!=tail){
		node *u=q[head]; if(++head==N) head=0;
		u->inq=false;
		for(edge *e=u->son;e;e=e->next){
			node *v=e->ed;
			if(u->dist[f]+e->w<v->dist[f]){
				v->dist[f]=u->dist[f]+e->w;
				if(!v->inq){
					v->inq=true;
					q[tail]=v;
					if(++tail==N) tail=0;
				}
			}
		}
	}
}
void renew(node *u){
	spfa(0,u);
	spfa(1,u);
}
bool work0(){
	for(int i=0;i<k;i++) seq[i].w=r[i];
	for(int i=1;i<=n;i++) V[i].dist[0]=V[i].dist[1]=inf;
	s[0]->dist[0]=0;
	renew(s[0]);
	s[1]->dist[1]=0;
	renew(s[1]);
	for(int i=0;i<k;i++) if(V[a[i]].dist[0]<V[a[i]].dist[1]){
		seq[i].w=l[i];
		renew(V+a[i]);
	}
	return t->dist[0]<t->dist[1];
}
bool work1(){
	for(int i=0;i<k;i++) seq[i].w=r[i];
	for(int i=1;i<=n;i++) V[i].dist[0]=V[i].dist[1]=inf;
	s[0]->dist[0]=0;
	renew(s[0]);
	s[1]->dist[1]=0;
	renew(s[1]);
	for(int i=0;i<k;i++) if(V[a[i]].dist[0]<=V[a[i]].dist[1]){
		seq[i].w=l[i];
		renew(V+a[i]);
	}
	return t->dist[0]<=t->dist[1];
}
int main(){
	n=getint(),m=getint(),k=getint();
	s[0]=V+getint(),s[1]=V+getint(),t=V+getint();
	for(int i=0;i<m;i++){
		int a=getint(),b=getint(),c=getint();
		*newE=(edge){V+b,V[a].son,c},V[a].son=newE++;
	}
	seq=newE;
	for(int i=0;i<k;i++){
		a[i]=getint(),b[i]=getint();
		l[i]=getint(),r[i]=getint();
		*newE=(edge){V+b[i],V[a[i]].son,r[i]},V[a[i]].son=newE++;
	}
	if(work0()){
		puts("WIN");
		for(int i=0;i<k;i++) printf("%d ",seq[i].w);
	}
	else
	if(work1()){
		puts("DRAW");
		for(int i=0;i<k;i++) printf("%d ",seq[i].w);
	}
	else
		puts("LOSE");
}


#include<bits/stdc++.h>
using namespace std;
const int N=10010,M=10010,K=110;
const long long Inf=1ll<<50;
struct edge
{
	int u,v,l,r;
}e[K]={};
int n,m,k,s1,s2,f;
int last[N]={},end[M+K]={},next[M+K]={},l[M+K]={},total_edge=0;
long long dis1[N]={},dis2[N]={};
inline void add_edge(int u,int v,int len)
{
	next[++total_edge]=last[u];
	last[u]=total_edge;
	end[total_edge]=v;
	l[total_edge]=len;
}
void init()
{
	scanf("%d%d%d%d%d%d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,u,v,l;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&l);
		add_edge(u,v,l);
	}
	for(int i=1;i<=k;++i)
	{
		scanf("%d%d%d%d",&e[i].u,&e[i].v,&e[i].l,&e[i].r);
		add_edge(e[i].u,e[i].v,e[i].r);
	}
}
void dijkstra(int s,long long *dis)
{
	fill(dis+1,dis+n+1,Inf);
	priority_queue<pair<long long,int> > q;
	bool v[N]={};
	q.push(make_pair(0,s));
	while(!q.empty())
	{
		pair<int,int> p=q.top();
		q.pop();
		long long d=-p.first,s=p.second;
		if(v[s])
			continue;
		v[s]=true;
		dis[s]=d;
		for(int i=last[s];i;i=next[i])
			if(!v[end[i]])
				q.push(make_pair(-(d+l[i]),end[i]));
	}
}
bool check(int d)
{
	for(int i=1;i<=k;++i)
		l[m+i]=e[i].r;
	bool flag=true;
	while(flag)
	{
		flag=false;
		dijkstra(s1,dis1);
		dijkstra(s2,dis2);
		for(int i=1;i<=k;++i)
			if(dis1[e[i].u]<dis2[e[i].u]+d && l[m+i]!=e[i].l)
			{
				l[m+i]=e[i].l;
				flag=true;
			}
	}
	return dis1[f]<dis2[f]+d;
}
void work()
{
	if(check(0))
	{
		puts("WIN");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else if(check(1))
	{
		puts("DRAW");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else puts("LOSE");
}
int main()
{
	init();
	work();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=10010,M=10010,K=110;
const long long Inf=1ll<<50;
struct edge
{
	int u,v,l,r;
}e[K]={};
int n,m,k,s1,s2,f;
int last[N]={},end[M+K]={},next[M+K]={},l[M+K]={},total_edge=0;
long long dis1[N]={},dis2[N]={};
inline void add_edge(int u,int v,int len)
{
	next[++total_edge]=last[u];
	last[u]=total_edge;
	end[total_edge]=v;
	l[total_edge]=len;
}
void init()
{
	scanf("%d%d%d%d%d%d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,u,v,l;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&l);
		add_edge(u,v,l);
	}
	for(int i=1;i<=k;++i)
	{
		scanf("%d%d%d%d",&e[i].u,&e[i].v,&e[i].l,&e[i].r);
		add_edge(e[i].u,e[i].v,e[i].r);
	}
}
void dijkstra(int s,long long *dis)
{
	fill(dis+1,dis+n+1,Inf);
	priority_queue<pair<int,int> > q;
	bool v[N]={};
	q.push(make_pair(dis[s],s));
	while(!q.empty())
	{
		pair<int,int> p=q.top();
		q.pop();
		long long d=-p.first,s=p.second;
		if(v[s])
			continue;
		v[s]=true;
		dis[s]=d;
		for(int i=last[s];i;i=next[i])
			if(!v[end[i]])
				q.push(make_pair(-(d+l[i]),end[i]));
	}
}
bool check(int d)
{
	for(int i=1;i<=k;++i)
		l[m+i]=e[i].r;
	bool flag=true;
	while(flag)
	{
		flag=false;
		dijkstra(s1,dis1);
		dijkstra(s2,dis2);
		for(int i=1;i<=k;++i)
			if(dis1[e[i].u]<dis2[e[i].u]+d && l[m+i]!=e[i].l)
			{
				l[m+i]=e[i].l;
				flag=true;
			}
	}
	return dis1[f]<dis2[f]+d;
}
void work()
{
	if(check(0))
	{
		puts("WIN");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else if(check(1))
	{
		puts("DRAW");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else puts("LOSE");
}
int main()
{
	init();
	work();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=10010,M=10010,K=110;
const long long Inf=1ll<<50;
struct edge
{
	int u,v,l,r;
}e[K]={};
int n,m,k,s1,s2,f;
int last[N]={},end[M+K]={},next[M+K]={},l[M+K]={},total_edge=0;
long long dis1[N]={},dis2[N]={};
inline void add_edge(int u,int v,int len)
{
	next[++total_edge]=last[u];
	last[u]=total_edge;
	end[total_edge]=v;
	l[total_edge]=len;
}
void init()
{
	scanf("%d%d%d%d%d%d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,u,v,l;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&l);
		add_edge(u,v,l);
	}
	for(int i=1;i<=k;++i)
	{
		scanf("%d%d%d%d",&e[i].u,&e[i].v,&e[i].l,&e[i].r);
		add_edge(e[i].u,e[i].v,e[i].r);
	}
}
void dijkstra(int s,long long *dis)
{
	fill(dis+1,dis+n+1,Inf);
	priority_queue<pair<int,int> > q;
	bool v[N]={};
	q.push(make_pair(0,s));
	while(!q.empty())
	{
		pair<int,int> p=q.top();
		q.pop();
		long long d=-p.first,s=p.second;
		if(v[s])
			continue;
		v[s]=true;
		dis[s]=d;
		for(int i=last[s];i;i=next[i])
			if(!v[end[i]])
				q.push(make_pair(-(d+l[i]),end[i]));
	}
}
bool check(int d)
{
	for(int i=1;i<=k;++i)
		l[m+i]=e[i].r;
	bool flag=true;
	while(flag)
	{
		flag=false;
		dijkstra(s1,dis1);
		dijkstra(s2,dis2);
		for(int i=1;i<=k;++i)
			if(dis1[e[i].u]<dis2[e[i].u]+d && l[m+i]!=e[i].l)
			{
				l[m+i]=e[i].l;
				flag=true;
			}
	}
	return dis1[f]<dis2[f]+d;
}
void work()
{
	if(check(0))
	{
		puts("WIN");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else if(check(1))
	{
		puts("DRAW");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else puts("LOSE");
}
int main()
{
	init();
	work();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=10010,M=10010,K=110;
const long long Inf=1ll<<50;
struct edge
{
	int u,v,l,r;
}e[K]={};
int n,m,k,s1,s2,f;
int last[N]={},end[M+K]={},next[M+K]={},l[M+K]={},total_edge=0;
long long dis1[N]={},dis2[N]={};
inline void add_edge(int u,int v,int len)
{
	next[++total_edge]=last[u];
	last[u]=total_edge;
	end[total_edge]=v;
	l[total_edge]=len;
}
void init()
{
	scanf("%d%d%d%d%d%d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,u,v,l;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&l);
		add_edge(u,v,l);
	}
	for(int i=1;i<=k;++i)
	{
		scanf("%d%d%d%d",&e[i].u,&e[i].v,&e[i].l,&e[i].r);
		add_edge(e[i].u,e[i].v,e[i].r);
	}
}
void spfa(int s,long long *dis)
{
	fill(dis+1,dis+n+1,Inf);
	queue<int> q;
	bool in[N]={};
	dis[s]=0;
	q.push(s);
	in[s]=true;
	while(!q.empty())
	{
		int s=q.front();
		q.pop();
		in[s]=false;
		for(int i=last[s];i;i=next[i])
		{
			int j=end[i];
			if(dis[s]+l[i]<dis[j])
			{
				dis[j]=dis[s]+l[i];
				if(!in[j])
				{
					in[j]=true;
					q.push(j);
				}
			}
		}
	}
}
bool check(int d)
{
	for(int i=1;i<=k;++i)
		l[m+i]=e[i].r;
	bool flag=true;
	while(flag)
	{
		flag=false;
		spfa(s1,dis1);
		spfa(s2,dis2);
		for(int i=1;i<=k;++i)
			if(dis1[e[i].u]<dis2[e[i].u]+d && l[m+i]!=e[i].l)
			{
				l[m+i]=e[i].l;
				flag=true;
			}
	}
	return dis1[f]<dis2[f]+d;
}
void work()
{
	if(check(0))
	{
		puts("WIN");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else if(check(1))
	{
		puts("DRAW");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else puts("LOSE");
}
int main()
{
	init();
	work();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=10010,M=10010,K=110;
const long long Inf=1ll<<50;
struct edge
{
	int u,v,l,r;
}e[K]={};
int n,m,k,s1,s2,f;
int last[N]={},end[M+K]={},next[M+K]={},l[M+K]={},total_edge=0;
long long dis1[N]={},dis2[N]={};
inline void add_edge(int u,int v,int len)
{
	next[++total_edge]=last[u];
	last[u]=total_edge;
	end[total_edge]=v;
	l[total_edge]=len;
}
void init()
{
	scanf("%d%d%d%d%d%d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,u,v,l;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&l);
		add_edge(u,v,l);
	}
	for(int i=1;i<=k;++i)
	{
		scanf("%d%d%d%d",&e[i].u,&e[i].v,&e[i].l,&e[i].r);
		add_edge(e[i].u,e[i].v,e[i].r);
	}
}
void dijkstra(int s,long long *dis)
{
	fill(dis+1,dis+n+1,Inf);
	priority_queue<pair<int,int> > q;
	bool v[N]={};
	q.push(make_pair(0,s));
	v[s]=true;
	while(!q.empty())
	{
		pair<int,int> p=q.top();
		q.pop();
		long long d=-p.first,s=p.second;
		if(v[s])
			continue;
		v[s]=true;
		dis[s]=d;
		for(int i=last[s];i;i=next[i])
			if(!v[end[i]])
				q.push(make_pair(-(d+l[i]),end[i]));
	}
}
bool check(int d)
{
	for(int i=1;i<=k;++i)
		l[m+i]=e[i].r;
	bool flag=true;
	while(flag)
	{
		flag=false;
		dijkstra(s1,dis1);
		dijkstra(s2,dis2);
		for(int i=1;i<=k;++i)
			if(dis1[e[i].u]<dis2[e[i].u]+d && l[m+i]!=e[i].l)
			{
				l[m+i]=e[i].l;
				flag=true;
			}
	}
	return dis1[f]<dis2[f]+d;
}
void work()
{
	if(check(0))
	{
		puts("WIN");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else if(check(1))
	{
		puts("DRAW");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else puts("LOSE");
}
int main()
{
	init();
	work();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=10010,M=10010,K=110;
const long long Inf=1ll<<50;
struct edge
{
	int u,v,l,r;
}e[K]={};
int n,m,k,s1,s2,f;
int last[N]={},end[M+K]={},next[M+K]={},l[M+K]={},total_edge=0;
long long dis1[N]={},dis2[N]={};
inline void add_edge(int u,int v,int len)
{
	next[++total_edge]=last[u];
	last[u]=total_edge;
	end[total_edge]=v;
	l[total_edge]=len;
}
void init()
{
	scanf("%d%d%d%d%d%d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,u,v,l;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&l);
		add_edge(u,v,l);
	}
	for(int i=1;i<=k;++i)
	{
		scanf("%d%d%d%d",&e[i].u,&e[i].v,&e[i].l,&e[i].r);
		add_edge(e[i].u,e[i].v,e[i].r);
	}
}
void dijkstra(int s,long long *dis)
{
	fill(dis+1,dis+n+1,Inf);
	priority_queue<pair<long long,int> > q;
	bool v[N]={};
	q.push(make_pair(0,s));
	while(!q.empty())
	{
		pair<long long,int> p=q.top();
		q.pop();
		long long d=-p.first,s=p.second;
		if(v[s])
			continue;
		v[s]=true;
		dis[s]=d;
		for(int i=last[s];i;i=next[i])
			if(!v[end[i]])
				q.push(make_pair(-(d+l[i]),end[i]));
	}
}
bool check(int d)
{
	for(int i=1;i<=k;++i)
		l[m+i]=e[i].r;
	bool flag=true;
	while(flag)
	{
		flag=false;
		dijkstra(s1,dis1);
		dijkstra(s2,dis2);
		for(int i=1;i<=k;++i)
			if(dis1[e[i].u]<dis2[e[i].u]+d && l[m+i]!=e[i].l)
			{
				l[m+i]=e[i].l;
				flag=true;
			}
	}
	return dis1[f]<dis2[f]+d;
}
void work()
{
	if(check(0))
	{
		puts("WIN");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else if(check(1))
	{
		puts("DRAW");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else puts("LOSE");
}
int main()
{
	init();
	work();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=10010,M=10010,K=110;
const long long Inf=1ll<<50;
struct edge
{
	int u,v,l,r;
}e[K]={};
int n,m,k,s1,s2,f;
int last[N]={},end[M+K]={},next[M+K]={},l[M+K]={},total_edge=0;
long long dis1[N]={},dis2[N]={};
inline void add_edge(int u,int v,int len)
{
	next[++total_edge]=last[u];
	last[u]=total_edge;
	end[total_edge]=v;
	l[total_edge]=len;
}
void init()
{
	scanf("%d%d%d%d%d%d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,u,v,l;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&l);
		add_edge(u,v,l);
	}
	for(int i=1;i<=k;++i)
	{
		scanf("%d%d%d%d",&e[i].u,&e[i].v,&e[i].l,&e[i].r);
		add_edge(e[i].u,e[i].v,e[i].r);
	}
}
void dijkstra(int s,long long *dis)
{
	fill(dis+1,dis+n+1,Inf);
	priority_queue<pair<int,int> > q;
	bool v[N]={};
	q.push(make_pair(dis[s],s));
	while(!q.empty())
	{
		pair<int,int> p=q.top();
		q.pop();
		long long d=-p.first,s=p.second;
		if(v[s])
			continue;
		v[s]=true;
		dis[s]=d;
		for(int i=last[s];i;i=next[i])
			if(!v[end[i]])
				q.push(make_pair(-(d+l[i]),end[i]));
	}
}
bool check(int d)
{
	bool flag=true;
	while(flag)
	{
		flag=false;
		dijkstra(s1,dis1);
		dijkstra(s2,dis2);
		for(int i=1;i<=k;++i)
			if(dis1[e[i].u]<dis2[e[i].u]+d && l[m+i]!=e[i].l)
			{
				l[m+i]=e[i].l;
				flag=true;
			}
	}
	for(int i=1;i<=k;++i)
		l[m+i]=e[i].r;
	return dis1[f]<dis2[f]+d;
}
void work()
{
	if(check(0))
	{
		puts("WIN");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else if(check(1))
	{
		puts("DRAW");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else puts("LOSE");
}
int main()
{
	init();
	work();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=10010,M=10010,K=220;
const long long Inf=1ll<<50;
struct edge
{
	int u,v,l,r;
}e[K]={};
int n,m,k,s1,s2,f;
int last[N]={},end[M+K]={},next[M+K]={},l[M+K]={},total_edge=0;
long long dis1[N]={},dis2[N]={};
inline void add_edge(int u,int v,int len)
{
	next[++total_edge]=last[u];
	last[u]=total_edge;
	end[total_edge]=v;
	l[total_edge]=len;
}
void init()
{
	scanf("%d%d%d%d%d%d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,u,v,l;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&l);
		add_edge(u,v,l);
	}
	for(int i=1;i<=k;++i)
	{
		scanf("%d%d%d%d",&e[i].u,&e[i].v,&e[i].l,&e[i].r);
		add_edge(e[i].u,e[i].v,e[i].r);
	}
}
void dijkstra(int s,long long *dis)
{
	fill(dis+1,dis+n+1,Inf);
	priority_queue<pair<int,int> > q;
	bool v[N]={};
	dis[s]=0ll;
	q.push(make_pair(dis[s],s));
	while(!q.empty())
	{
		pair<int,int> p=q.top();
		q.pop();
		long long d=-p.first,s=p.second;
		if(v[s])
			continue;
		v[s]=true;
		dis[s]=d;
		for(int i=last[s];i;i=next[i])
			if(!v[end[i]])
				q.push(make_pair(-(d+l[i]),end[i]));
	}
}
bool check(int d)
{
	bool flag=true;
	while(flag)
	{
		flag=false;
		dijkstra(s1,dis1);
		dijkstra(s2,dis2);
		for(int i=1;i<=k;++i)
			if(dis1[e[i].u]<dis2[e[i].u]+d && l[m+i]!=e[i].l)
			{
				l[m+i]=e[i].l;
				flag=true;
			}
	}
	return dis1[f]<dis2[f]+d;
}
void work()
{
	if(check(0))
	{
		puts("WIN");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else if(check(1))
	{
		puts("DRAW");
		for(int i=1;i<=k;++i)
			printf("%d%c",l[i+m]," \n"[i==k]);
	}
	else puts("LOSE");
}
int main()
{
	init();
	work();
	return 0;
}


#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
ll n,k,m,s1,s2,f,dist1[11000],dist2[11000],x[11000],y[11000],c1[11000],c2[11000],ans[11000];
vector<pair<ll,ll> > edge[11000],edge2[11000];

int main()
{
	scanf("%I64d%I64d%I64d",&n,&m,&k);
	scanf("%I64d%I64d%I64d",&s1,&s2,&f);
	for (ll i=0;i<m;i++)
	{
		ll a,b,c;
		scanf("%I64d%I64d%I64d",&a,&b,&c);
		edge[a].pb(mp(c,b));
		edge2[a].pb(mp(c,b));
	}
	for (ll i=0;i<k;i++)
	{
		scanf("%I64d%I64d%I64d%I64d",&x[i],&y[i],&c1[i],&c2[i]);
		edge[x[i]].pb(mp(c1[i],y[i]));
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	set<pair<ll,ll> > sets;
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist1[edge[pos][i].second]=c+edge[pos][i].first;
				sets.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	set<pair<ll,ll> > sets2;
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist2[edge[pos][i].second]=c+edge[pos][i].first;
				sets2.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	for (ll i=0;i<k;i++)
	{
		if (dist1[y[i]]-dist1[x[i]]!=c1[i] && dist2[y[i]]-dist2[x[i]]==c1[i])
		{
			ans[i]=c2[i];
			edge2[x[i]].pb(mp(c2[i],y[i]));
		}
		else
		{
			if (dist1[y[i]]-dist1[x[i]]==c1[i] && dist2[y[i]]-dist2[x[i]]!=c1[i])
			{
				ans[i]=c1[i];
				edge2[x[i]].pb(mp(c1[i],y[i]));
			}
			else
			{
				ans[i]=c2[i];
				edge2[x[i]].pb(mp(c2[i],y[i]));
			}
		}
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	sets.clear();
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge2[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge2[pos][i].second]>c+edge2[pos][i].first)
			{
				dist1[edge2[pos][i].second]=c+edge2[pos][i].first;
				sets.insert(mp(c+edge2[pos][i].first,edge2[pos][i].second));
			}
		}
	}
	sets2.clear();
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge2[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge2[pos][i].second]>c+edge2[pos][i].first)
			{
				dist2[edge2[pos][i].second]=c+edge2[pos][i].first;
				sets2.insert(mp(c+edge2[pos][i].first,edge2[pos][i].second));
			}
		}
	}
	if (dist1[f]>dist2[f])
	{
		printf("LOSE\n");
	}
	else
	{
		if (dist1[f]==dist2[f])
			printf("DRAW\n");
		else
			printf("WIN\n");
		for (ll i=0;i<k;i++)
		{
			if (i!=0)
				printf(" ");
			printf("%I64d",ans[i]);
		}
		printf("\n");
	}
	return 0;
}


#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
ll n,k,m,s1,s2,f,dist1[11000],dist2[11000],x[11000],y[11000],c1[11000],c2[11000],ans[11000];
vector<pair<ll,ll> > edge[11000],edge2[110][11000];
bool flag[11000];

int main()
{
	scanf("%I64d%I64d%I64d",&n,&m,&k);
	scanf("%I64d%I64d%I64d",&s1,&s2,&f);
	for (ll i=0;i<m;i++)
	{
		ll a,b,c;
		scanf("%I64d%I64d%I64d",&a,&b,&c);
		edge[a].pb(mp(c,b));
	}
	for (ll i=0;i<k;i++)
	{
		scanf("%I64d%I64d%I64d%I64d",&x[i],&y[i],&c1[i],&c2[i]);
		edge[x[i]].pb(mp(c2[i],y[i]));
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	set<pair<ll,ll> > sets;
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist1[edge[pos][i].second]=c+edge[pos][i].first;
				sets.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	set<pair<ll,ll> > sets2;
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist2[edge[pos][i].second]=c+edge[pos][i].first;
				sets2.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	ll cnt=0;
	while (1)
	{
		cnt++;
		bool brt=true;
		for (ll i=0;i<k;i++)
		{
			if (dist1[x[i]]<dist2[x[i]] && !flag[i])
			{
				brt=false;
				flag[i]=true;
			}
		}
		if (brt)
			break;
		for (ll i=1;i<=n;i++)
			edge2[cnt][i]=edge[i];
		for (ll i=0;i<k;i++)
		{
			if (flag[i])
				edge2[cnt][x[i]].pb(mp(c1[i],y[i]));
			else
				edge2[cnt][x[i]].pb(mp(c2[i],y[i]));
		}
		for (ll i=1;i<=n;i++)
		{
			dist1[i]=(1LL<<62);
			dist2[i]=(1LL<<62);
		}
		sets.clear();
		sets.insert(mp(0,s1));
		dist1[s1]=0;
		while (!sets.empty())
		{
			ll c=sets.begin()->first;
			ll pos=sets.begin()->second;
			if (pos==f)
				break;
			sets.erase(sets.begin());
			if (c>dist1[pos])
				continue;
			ll l=edge2[cnt][pos].size();
			for (ll i=0;i<l;i++)
			{
				if (dist1[edge2[cnt][pos][i].second]>c+edge2[cnt][pos][i].first)
				{
					dist1[edge2[cnt][pos][i].second]=c+edge2[cnt][pos][i].first;
					sets.insert(mp(c+edge2[cnt][pos][i].first,edge2[cnt][pos][i].second));
				}
			}
		}
		sets2.clear();
		sets2.insert(mp(0,s2));
		dist2[s2]=0;
		while (!sets2.empty())
		{
			ll c=sets2.begin()->first;
			ll pos=sets2.begin()->second;
			if (pos==f)
				break;
			sets2.erase(sets2.begin());
			if (c>dist2[pos])
				continue;
			ll l=edge2[cnt][pos].size();
			for (ll i=0;i<l;i++)
			{
				if (dist2[edge2[cnt][pos][i].second]>c+edge2[cnt][pos][i].first)
				{
					dist2[edge2[cnt][pos][i].second]=c+edge2[cnt][pos][i].first;
					sets2.insert(mp(c+edge2[cnt][pos][i].first,edge2[cnt][pos][i].second));
				}
			}
		}
	}
	if (dist1[f]>dist2[f])
	{
		printf("LOSE\n");
	}
	else
	{
		if (dist1[f]==dist2[f])
			printf("DRAW\n");
		else
			printf("WIN\n");
		for (ll i=0;i<k;i++)
		{
			if (i!=0)
				printf(" ");
			printf("%I64d",flag[i]?c1[i]:c2[i]);
		}
		printf("\n");
	}
	return 0;
}


#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
ll n,k,m,s1,s2,f,dist1[11000],dist2[11000],x[11000],y[11000],c1[11000],c2[11000],ans[11000];
vector<pair<ll,ll> > edge[11000],edge2[110][11000];
bool flag[11000];

int main()
{
	scanf("%I64d%I64d%I64d",&n,&m,&k);
	scanf("%I64d%I64d%I64d",&s1,&s2,&f);
	for (ll i=0;i<m;i++)
	{
		ll a,b,c;
		scanf("%I64d%I64d%I64d",&a,&b,&c);
		edge[a].pb(mp(c,b));
	}
	for (ll i=0;i<k;i++)
	{
		scanf("%I64d%I64d%I64d%I64d",&x[i],&y[i],&c1[i],&c2[i]);
		edge[x[i]].pb(mp(c2[i],y[i]));
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	set<pair<ll,ll> > sets;
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist1[edge[pos][i].second]=c+edge[pos][i].first;
				sets.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	set<pair<ll,ll> > sets2;
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist2[edge[pos][i].second]=c+edge[pos][i].first;
				sets2.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	ll cnt=0
	while (1)
	{
		bool brt=true;
		for (ll i=0;i<k;i++)
		{
			if (dist1[x[i]]<dist2[x[i]] && !flag[i])
			{
				brt=false;
				flag[i]=true;
			}
		}
		for (ll i=1;i<=n;i++)
			edge2[cnt][i]=edge[i];
		for (ll i=0;i<k;i++)
		{
			if (flag[i])
				edge2[cnt][x[i]].pb(mp(c1[i],y[i]));
			else
				edge2[cnt][x[i]].pb(mp(c2[i],y[i]));
		}
		for (ll i=1;i<=n;i++)
		{
			dist1[i]=(1LL<<62);
			dist2[i]=(1LL<<62);
		}
		sets.clear();
		sets.insert(mp(0,s1));
		dist1[s1]=0;
		while (!sets.empty())
		{
			ll c=sets.begin()->first;
			ll pos=sets.begin()->second;
			if (pos==f)
				break;
			sets.erase(sets.begin());
			if (c>dist1[pos])
				continue;
			ll l=edge2[cnt][pos].size();
			for (ll i=0;i<l;i++)
			{
				if (dist1[edge2[cnt][pos][i].second]>c+edge2[cnt][pos][i].first)
				{
					dist1[edge2[cnt][pos][i].second]=c+edge2[cnt][pos][i].first;
					sets.insert(mp(c+edge2[cnt][pos][i].first,edge2[cnt][pos][i].second));
				}
			}
		}
		sets2.clear();
		sets2.insert(mp(0,s2));
		dist2[s2]=0;
		while (!sets2.empty())
		{
			ll c=sets2.begin()->first;
			ll pos=sets2.begin()->second;
			if (pos==f)
				break;
			sets2.erase(sets2.begin());
			if (c>dist2[pos])
				continue;
			ll l=edge2[cnt][pos].size();
			for (ll i=0;i<l;i++)
			{
				if (dist2[edge2[cnt][pos][i].second]>c+edge2[cnt][pos][i].first)
				{
					dist2[edge2[cnt][pos][i].second]=c+edge2[cnt][pos][i].first;
					sets2.insert(mp(c+edge2[cnt][pos][i].first,edge2[cnt][pos][i].second));
				}
			}
		}
	}
	if (dist1[f]>dist2[f])
	{
		printf("LOSE\n");
	}
	else
	{
		if (dist1[f]==dist2[f])
			printf("DRAW\n");
		else
			printf("WIN\n");
		for (ll i=0;i<k;i++)
		{
			if (i!=0)
				printf(" ");
			printf("%I64d",flag[i]?c1[i]:c2[i]);
		}
		printf("\n");
	}
	return 0;
}


#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
ll n,k,m,s1,s2,f,dist1[11000],dist2[11000],x[11000],y[11000],c1[11000],c2[11000],ans[11000];
vector<pair<ll,ll> > edge[11000],edge2[11000];

int main()
{
	scanf("%I64d%I64d%I64d",&n,&m,&k);
	scanf("%I64d%I64d%I64d",&s1,&s2,&f);
	for (ll i=0;i<m;i++)
	{
		ll a,b,c;
		scanf("%I64d%I64d%I64d",&a,&b,&c);
		edge[a].pb(mp(c,b));
		edge2[a].pb(mp(c,b));
	}
	for (ll i=0;i<k;i++)
	{
		scanf("%I64d%I64d%I64d%I64d",&x[i],&y[i],&c1[i],&c2[i]);
		edge[x[i]].pb(mp(c1[i],y[i]));
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	set<pair<ll,ll> > sets;
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist1[edge[pos][i].second]=c+edge[pos][i].first;
				sets.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	set<pair<ll,ll> > sets2;
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist2[edge[pos][i].second]=c+edge[pos][i].first;
				sets2.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	for (ll i=0;i<k;i++)
	{
		if (dist1[y[i]]-dist1[x[i]]==c1[i])
		{
			ans[i]=c1[i];
			edge2[x[i]].pb(mp(c1[i],y[i]));
		}
		else
		{
			ans[i]=c2[i];
			edge2[x[i]].pb(mp(c2[i],y[i]));
		}
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	sets.clear();
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge2[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge2[pos][i].second]>c+edge2[pos][i].first)
			{
				dist1[edge2[pos][i].second]=c+edge2[pos][i].first;
				sets.insert(mp(c+edge2[pos][i].first,edge2[pos][i].second));
			}
		}
	}
	sets2.clear();
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge2[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge2[pos][i].second]>c+edge2[pos][i].first)
			{
				dist2[edge2[pos][i].second]=c+edge2[pos][i].first;
				sets2.insert(mp(c+edge2[pos][i].first,edge2[pos][i].second));
			}
		}
	}
	if (dist1[f]>dist2[f])
	{
		printf("LOSE\n");
	}
	else
	{
		if (dist1[f]==dist2[f])
			printf("DRAW\n");
		else
			printf("WIN\n");
		for (ll i=0;i<k;i++)
		{
			if (i!=0)
				printf(" ");
			printf("%I64d",ans[i]);
		}
		printf("\n");
	}
	return 0;
}


#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
ll n,k,m,s1,s2,f,dist1[11000],dist2[11000],x[11000],y[11000],c1[11000],c2[11000],ans[11000];
vector<pair<ll,ll> > edge[11000],edge2[110][11000];
bool flag[11000];

int main()
{
	scanf("%I64d%I64d%I64d",&n,&m,&k);
	scanf("%I64d%I64d%I64d",&s1,&s2,&f);
	for (ll i=0;i<m;i++)
	{
		ll a,b,c;
		scanf("%I64d%I64d%I64d",&a,&b,&c);
		edge[a].pb(mp(c,b));
	}
	for (ll i=0;i<k;i++)
	{
		scanf("%I64d%I64d%I64d%I64d",&x[i],&y[i],&c1[i],&c2[i]);
		edge[x[i]].pb(mp(c2[i],y[i]));
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	set<pair<ll,ll> > sets;
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist1[edge[pos][i].second]=c+edge[pos][i].first;
				sets.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	set<pair<ll,ll> > sets2;
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist2[edge[pos][i].second]=c+edge[pos][i].first;
				sets2.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	ll cnt=0;
	while (1)
	{
		bool brt=true;
		for (ll i=0;i<k;i++)
		{
			if (dist1[x[i]]<dist2[x[i]] && !flag[i])
			{
				brt=false;
				flag[i]=true;
			}
		}
		for (ll i=1;i<=n;i++)
			edge2[cnt][i]=edge[i];
		for (ll i=0;i<k;i++)
		{
			if (flag[i])
				edge2[cnt][x[i]].pb(mp(c1[i],y[i]));
			else
				edge2[cnt][x[i]].pb(mp(c2[i],y[i]));
		}
		for (ll i=1;i<=n;i++)
		{
			dist1[i]=(1LL<<62);
			dist2[i]=(1LL<<62);
		}
		sets.clear();
		sets.insert(mp(0,s1));
		dist1[s1]=0;
		while (!sets.empty())
		{
			ll c=sets.begin()->first;
			ll pos=sets.begin()->second;
			if (pos==f)
				break;
			sets.erase(sets.begin());
			if (c>dist1[pos])
				continue;
			ll l=edge2[cnt][pos].size();
			for (ll i=0;i<l;i++)
			{
				if (dist1[edge2[cnt][pos][i].second]>c+edge2[cnt][pos][i].first)
				{
					dist1[edge2[cnt][pos][i].second]=c+edge2[cnt][pos][i].first;
					sets.insert(mp(c+edge2[cnt][pos][i].first,edge2[cnt][pos][i].second));
				}
			}
		}
		sets2.clear();
		sets2.insert(mp(0,s2));
		dist2[s2]=0;
		while (!sets2.empty())
		{
			ll c=sets2.begin()->first;
			ll pos=sets2.begin()->second;
			if (pos==f)
				break;
			sets2.erase(sets2.begin());
			if (c>dist2[pos])
				continue;
			ll l=edge2[cnt][pos].size();
			for (ll i=0;i<l;i++)
			{
				if (dist2[edge2[cnt][pos][i].second]>c+edge2[cnt][pos][i].first)
				{
					dist2[edge2[cnt][pos][i].second]=c+edge2[cnt][pos][i].first;
					sets2.insert(mp(c+edge2[cnt][pos][i].first,edge2[cnt][pos][i].second));
				}
			}
		}
	}
	if (dist1[f]>dist2[f])
	{
		printf("LOSE\n");
	}
	else
	{
		if (dist1[f]==dist2[f])
			printf("DRAW\n");
		else
			printf("WIN\n");
		for (ll i=0;i<k;i++)
		{
			if (i!=0)
				printf(" ");
			printf("%I64d",flag[i]?c1[i]:c2[i]);
		}
		printf("\n");
	}
	return 0;
}


#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
ll n,k,m,s1,s2,f,dist1[11000],dist2[11000],x[11000],y[11000],c1[11000],c2[11000],ans[11000];
vector<pair<ll,ll> > edge[11000],edge2[11000];

int main()
{
	scanf("%I64d%I64d%I64d",&n,&m,&k);
	scanf("%I64d%I64d%I64d",&s1,&s2,&f);
	for (ll i=0;i<m;i++)
	{
		ll a,b,c;
		scanf("%I64d%I64d%I64d",&a,&b,&c);
		edge[a].pb(mp(c,b));
		edge2[a].pb(mp(c,b));
	}
	for (ll i=0;i<k;i++)
	{
		scanf("%I64d%I64d%I64d%I64d",&x[i],&y[i],&c1[i],&c2[i]);
		edge[x[i]].pb(mp(c1[i],y[i]));
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	set<pair<ll,ll> > sets;
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist1[edge[pos][i].second]=c+edge[pos][i].first;
				sets.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	set<pair<ll,ll> > sets2;
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist2[edge[pos][i].second]=c+edge[pos][i].first;
				sets2.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	for (ll i=0;i<k;i++)
	{
		if (dist1[y[i]]-dist1[x[i]]==c1[i] && dist2[y[i]]-dist2[x[i]]==c1[i])
		{
			ans[i]=c2[i];
			edge2[x[i]].pb(mp(c2[i],y[i]));
		}
		else
		{
			if (dist1[y[i]]-dist1[x[i]]==c1[i])
			{
				ans[i]=c1[i];
				edge2[x[i]].pb(mp(c1[i],y[i]));
			}
			else
			{
				ans[i]=c2[i];
				edge2[x[i]].pb(mp(c2[i],y[i]));
			}
		}
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	sets.clear();
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge2[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge2[pos][i].second]>c+edge2[pos][i].first)
			{
				dist1[edge2[pos][i].second]=c+edge2[pos][i].first;
				sets.insert(mp(c+edge2[pos][i].first,edge2[pos][i].second));
			}
		}
	}
	sets2.clear();
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge2[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge2[pos][i].second]>c+edge2[pos][i].first)
			{
				dist2[edge2[pos][i].second]=c+edge2[pos][i].first;
				sets2.insert(mp(c+edge2[pos][i].first,edge2[pos][i].second));
			}
		}
	}
	if (dist1[f]>dist2[f])
	{
		printf("LOSE\n");
	}
	else
	{
		if (dist1[f]==dist2[f])
			printf("DRAW\n");
		else
			printf("WIN\n");
		for (ll i=0;i<k;i++)
		{
			if (i!=0)
				printf(" ");
			printf("%I64d",ans[i]);
		}
		printf("\n");
	}
	return 0;
}


#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
ll n,k,m,s1,s2,f,dist1[11000],dist2[11000],x[11000],y[11000],c1[11000],c2[11000],ans[11000];
vector<pair<ll,ll> > edge[11000],edge2[110000];

int main()
{
	scanf("%I64d%I64d%I64d",&n,&m,&k);
	scanf("%I64d%I64d%I64d",&s1,&s2,&f);
	for (ll i=0;i<m;i++)
	{
		ll a,b,c;
		scanf("%I64d%I64d%I64d",&a,&b,&c);
		edge[a].pb(mp(c,b));
		edge2[a].pb(mp(c,b));
	}
	for (ll i=0;i<k;i++)
	{
		scanf("%I64d%I64d%I64d%I64d",&x[i],&y[i],&c1[i],&c2[i]);
		edge[x[i]].pb(mp(c1[i],y[i]));
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	set<pair<ll,ll> > sets;
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist1[edge[pos][i].second]=c+edge[pos][i].first;
				sets.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	set<pair<ll,ll> > sets2;
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge[pos][i].second]>c+edge[pos][i].first)
			{
				dist2[edge[pos][i].second]=c+edge[pos][i].first;
				sets2.insert(mp(c+edge[pos][i].first,edge[pos][i].second));
			}
		}
	}
	for (ll i=0;i<k;i++)
	{
		if (dist1[y[i]]-dist1[x[i]]!=c1[i] && dist2[y[i]]-dist2[x[i]]==c1[i])
		{
			ans[i]=c2[i];
			edge2[x[i]].pb(mp(c2[i],y[i]));
		}
		else
		{
			ans[i]=c1[i];
			edge2[x[i]].pb(mp(c1[i],y[i]));
		}
	}
	for (ll i=1;i<=n;i++)
	{
		dist1[i]=(1LL<<62);
		dist2[i]=(1LL<<62);
	}
	sets.clear();
	sets.insert(mp(0,s1));
	dist1[s1]=0;
	while (!sets.empty())
	{
		ll c=sets.begin()->first;
		ll pos=sets.begin()->second;
		if (pos==f)
			break;
		sets.erase(sets.begin());
		if (c>dist1[pos])
			continue;
		ll l=edge2[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist1[edge2[pos][i].second]>c+edge2[pos][i].first)
			{
				dist1[edge2[pos][i].second]=c+edge2[pos][i].first;
				sets.insert(mp(c+edge2[pos][i].first,edge2[pos][i].second));
			}
		}
	}
	sets2.clear();
	sets2.insert(mp(0,s2));
	dist2[s2]=0;
	while (!sets2.empty())
	{
		ll c=sets2.begin()->first;
		ll pos=sets2.begin()->second;
		if (pos==f)
			break;
		sets2.erase(sets2.begin());
		if (c>dist2[pos])
			continue;
		ll l=edge2[pos].size();
		for (ll i=0;i<l;i++)
		{
			if (dist2[edge2[pos][i].second]>c+edge2[pos][i].first)
			{
				dist2[edge2[pos][i].second]=c+edge2[pos][i].first;
				sets2.insert(mp(c+edge2[pos][i].first,edge2[pos][i].second));
			}
		}
	}
	if (dist1[f]>dist2[f])
	{
		printf("LOSE\n");
	}
	else
	{
		if (dist1[f]==dist2[f])
			printf("DRAW\n");
		else
			printf("WIN\n");
		for (ll i=0;i<k;i++)
		{
			if (i!=0)
				printf(" ");
			printf("%I64d",ans[i]);
		}
		printf("\n");
	}
	return 0;
}


#include <vector>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
using namespace std;

#define eps 1e-9
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define sz(v) ((int)(v).size())
#define all(v) v.begin(),v.end()
#define same(a,b) (fabs((a)-(b))<eps)
#define set(arr,with) memset(arr,with,sizeof(arr))
#define add(target,value,mod) target = (target+value)%(mod)
#define put_min(target,value) target = min(target,value)
#define put_max(target,value) target = max(target,value)
typedef long long lld;
typedef pair<int,int> pii;
typedef pair<lld,int> pli;

#define MAXN 10004

int N,M,K,S1,S2,F;
int T[MAXN],value[101],L[101],R[101];
lld D[MAXN];
vector <int> conr[MAXN],cons[MAXN];
priority_queue <pli> que;

int main()
{
    int i,j,k,d,q,t,x;
    scanf("%d%d%d%d%d%d",&N,&M,&K,&S1,&S2,&F);
    for (i=1;i<=M;i++){
        scanf("%d%d%d",&j,&k,&d);
        conr[j].push_back(k), conr[j].push_back(d);
    }
    for (i=1;i<=K;i++){
        scanf("%d%d%d%d",&j,&k,L+i,R+i);
        cons[j].push_back(k); cons[j].push_back(i);
    }
    if (S1 == S2){
        puts("DRAW");
        for (i=1;i<=K;i++) printf("%d ",L[i]);
        puts("");
        return 0;
    }
    for (i=1;i<=N;i++) D[i] = 1e17;
    for (i=1;i<=K;i++) value[i] = L[i];
    D[S1] = D[S2] = 0;
    T[S1] = 1, T[S2] = 2;
    que.push(mp(0,S1));
    que.push(mp(0,S2));
    while (!que.empty()){
        lld d = que.top().fr;
        q = que.top().sc;
        que.pop();
        if (-d != D[q]) continue;
        t = T[q];
        for (i=0;i<sz(conr[q]);i+=2){
            k = conr[q][i]; d = conr[q][i+1];
            if (D[k] > D[q]+d)
                D[k] = D[q]+d, T[k] = T[q], que.push(mp(-D[k],k));
            else if (D[k] == D[q]+d)
                T[k] |= T[q];
        }
        for (i=0;i<sz(cons[q]);i+=2){
            k = cons[q][i], x = cons[q][i+1];
            d = L[x];
            if (t&2) d = R[x];
            value[x] = (int)d;
            if (D[k] > D[q]+d)
                D[k] = D[q]+d, T[k] = T[q], que.push(mp(-D[k],k));
            else if (D[k] == D[q]+d)
                T[k] |= T[q];
        }
    }
    if (T[F] == 1) puts("WIN");
    else if (T[F] == 3) puts("DRAW");
    else puts("LOSE");
    if (T[F]&1){
        for (i=1;i<=K;i++) printf("%d ",value[i]);
        puts("");
    }
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define N 11000
#define M 110
#define INF 1000000
int dis1[N],dis2[N],z1[M],z2[M],v[N],next[N],head[N],cost[N],q[N*100],num=0,n,m,k,s1,s2,ed,rec[M];
bool vis[N],pd[M];
void add(int x,int y,int z){
     v[++num]=y;next[num]=head[x];head[x]=num;cost[num]=z;
     }
void spfa(int st,int *dis){
     for(int i=1;i<=n;i++)dis[i]=INF,vis[i]=0;
     dis[st]=0;vis[st]=1;
     int t=0,w=1;q[1]=st;
     while(t<w){
       int u=q[++t];
       for(int i=head[u];i;i=next[i])
         if(dis[u]+cost[i]<dis[v[i]]){
           dis[v[i]]=dis[u]+cost[i];
           if(!vis[v[i]]){
             q[++w]=v[i];
             vis[v[i]]=1;
           }
         }
       vis[u]=0;
     }
}
int main(){
    scanf("%d%d%d",&n,&m,&k);
    scanf("%d%d%d",&s1,&s2,&ed);
    for(int i=1;i<=m;i++){
      int x,y,z;
      scanf("%d%d%d",&x,&y,&z);
      add(x,y,z);
      if(num>41)printf("%d %d %d\n",x,y,z);
    }
    for(int i=1;i<=k;i++){
      int x,y;
      scanf("%d%d%d%d",&x,&y,&z1[i],&z2[i]);rec[i]=x;
      add(x,y,z2[i]);pd[i]=1;
       if(num>41)printf("%d %d %d %d\n",x,y,z1[i],z2[i]);
    }
    spfa(s1,dis1);
    spfa(s2,dis2);
    for(int i=1;i<=k;i++)
      if(dis1[ed]>=dis2[ed] && pd[i] && dis1[rec[i]]<dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
      }
    if(dis1[ed]<dis2[ed]){
      printf("WIN\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    for(int i=1;i<=k;i++)
      if(dis1[ed]>dis2[ed] && pd[i] && dis1[rec[i]]<=dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
      }
    if(dis1[ed]<=dis2[ed]){
      printf("DRAW\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    printf("LOSE\n");
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define N 11000
#define M 110
#define INF 1000000
int dis1[N],dis2[N],z1[M],z2[M],v[N],next[N],head[N],cost[N],q[N*100],num=0,n,m,k,s1,s2,ed,rec[M];
bool vis[N],pd[M];
void add(int x,int y,int z){
     v[++num]=y;next[num]=head[x];head[x]=num;cost[num]=z;
     }
void spfa(int st,int *dis){
     for(int i=1;i<=n;i++)dis[i]=INF,vis[i]=0;
     dis[st]=0;vis[st]=1;
     int t=0,w=1;q[1]=st;
     while(t<w){
       int u=q[++t];
       for(int i=head[u];i;i=next[i])
         if(dis[u]+cost[i]<dis[v[i]]){
           dis[v[i]]=dis[u]+cost[i];
           if(!vis[v[i]]){
             q[++w]=v[i];
             vis[v[i]]=1;
           }
         }
       vis[u]=0;
     }
}
int main(){
    scanf("%d%d%d",&n,&m,&k);
    scanf("%d%d%d",&s1,&s2,&ed);
    for(int i=1;i<=m;i++){
      int x,y,z;
      scanf("%d%d%d",&x,&y,&z);
      add(x,y,z);
      if(num>44)printf("%d %d %d\n",x,y,z);
    }
    for(int i=1;i<=k;i++){
      int x,y;
      scanf("%d%d%d%d",&x,&y,&z1[i],&z2[i]);rec[i]=x;
      add(x,y,z2[i]);pd[i]=1;
       if(num>44)printf("%d %d %d\n",x,y,z1[i],z2[i]);
    }
    spfa(s1,dis1);
    spfa(s2,dis2);
    for(int i=1;i<=k;i++)
      if(dis1[ed]>=dis2[ed] && pd[i] && dis1[rec[i]]<dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
      }
    if(dis1[ed]<dis2[ed]){
      printf("WIN\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    for(int i=1;i<=k;i++)
      if(dis1[ed]>dis2[ed] && pd[i] && dis1[rec[i]]<=dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
      }
    if(dis1[ed]<=dis2[ed]){
      printf("DRAW\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    printf("LOSE\n");
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define N 11000
#define M 110
#define INF 1000000
int dis1[N],dis2[N],z1[M],z2[M],v[N],next[N],head[N],cost[N],q[N*100],num=0,n,m,k,s1,s2,ed,rec[M];
bool vis[N],pd[M];
void add(int x,int y,int z){
     v[++num]=y;next[num]=head[x];head[x]=num;cost[num]=z;
     }
void spfa(int st,int *dis){
     for(int i=1;i<=n;i++)dis[i]=INF,vis[i]=0;
     dis[st]=0;vis[st]=1;
     int t=0,w=1;q[1]=st;
     while(t<w){
       int u=q[++t];
       for(int i=head[u];i;i=next[i])
         if(dis[u]+cost[i]<dis[v[i]]){
           dis[v[i]]=dis[u]+cost[i];
           if(!vis[v[i]]){
             q[++w]=v[i];
             vis[v[i]]=1;
           }
         }
       vis[u]=0;
     }
}
int main(){
    scanf("%d%d%d",&n,&m,&k);
    scanf("%d%d%d",&s1,&s2,&ed);
    for(int i=1;i<=m;i++){
      int x,y,z;
      scanf("%d%d%d",&x,&y,&z);
      add(x,y,z);
      if(num>41)printf("%d %d %d\n",x,y,z);
    }
    for(int i=1;i<=k;i++){
      int x,y;
      scanf("%d%d%d%d",&x,&y,&z1[i],&z2[i]);rec[i]=x;
      add(x,y,z2[i]);pd[i]=1;
       if(num>41)printf("%d %d %d\n",x,y,z1[i],z2[i]);
    }
    spfa(s1,dis1);
    spfa(s2,dis2);
    for(int i=1;i<=k;i++)
      if(dis1[ed]>=dis2[ed] && pd[i] && dis1[rec[i]]<dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
      }
    if(dis1[ed]<dis2[ed]){
      printf("WIN\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    for(int i=1;i<=k;i++)
      if(dis1[ed]>dis2[ed] && pd[i] && dis1[rec[i]]<=dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
      }
    if(dis1[ed]<=dis2[ed]){
      printf("DRAW\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    printf("LOSE\n");
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define N 11000
#define M 110
#define INF 1000000000
long long dis1[N],dis2[N],cost[N];
int z1[M],z2[M],v[N],next[N],head[N],q[N*100],num=0,n,m,k,s1,s2,ed,rec[M];
bool vis[N],pd[M];
void add(int x,int y,long long z){
     v[++num]=y;next[num]=head[x];head[x]=num;cost[num]=z;
     }
void spfa(int st,long long *dis){
     for(int i=1;i<=n;i++)dis[i]=(long long)INF*10000,vis[i]=0;
     dis[st]=0;vis[st]=1;
     int t=0,w=1;q[1]=st;
     while(t<w){
       int u=q[++t];
       if(u==7){
                int tt=0;
                }
       for(int i=head[u];i;i=next[i])
         if(dis[u]+cost[i]<dis[v[i]]){
           dis[v[i]]=dis[u]+cost[i];
           if(!vis[v[i]]){
             q[++w]=v[i];
             vis[v[i]]=1;
           }
         }
       vis[u]=0;
     }
}
int main(){
    scanf("%d%d%d",&n,&m,&k);
    scanf("%d%d%d",&s1,&s2,&ed);
    for(int i=1;i<=m;i++){
      int x,y,z;
      scanf("%d%d%d",&x,&y,&z);
      add(x,y,z);
    }
    for(int i=1;i<=k;i++){
      int x,y;
      scanf("%d%d%d%d",&x,&y,&z1[i],&z2[i]);rec[i]=x;
      add(x,y,z2[i]);pd[i]=1;
    }
    spfa(s1,dis1);
    spfa(s2,dis2);
 //   for(int i=1;i<=n;i++)printf("%I64d ",dis1[i]);printf("\n");
  //  for(int i=1;i<=n;i++)printf("%I64d ",dis2[i]);printf("\n");
    while(dis1[ed]>=dis2[ed]){
    int pdd=1;
    for(int i=1;i<=k;i++){
      if(dis1[ed]>=dis2[ed] && pd[i] && dis1[rec[i]]<dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
        pdd=0;
      }
      }
      if(pdd)break;
    }
    if(dis1[ed]<dis2[ed]){
      printf("WIN\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    while(dis1[ed]>dis2[ed]){
    int pdd=1;
    for(int i=1;i<=k;i++){
      if(dis1[ed]>dis2[ed] && pd[i] && dis1[rec[i]]<=dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
        pdd=0;
      }
      }
      if(pdd)break;
    }
    if(dis1[ed]<=dis2[ed]){
      printf("DRAW\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    printf("LOSE\n");
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define N 11000
#define M 110
#define INF 1000000
int dis1[N],dis2[N],z1[M],z2[M],v[N],next[N],head[N],cost[N],q[N*100],num=0,n,m,k,s1,s2,ed,rec[M];
bool vis[N],pd[M];
void add(int x,int y,int z){
     v[++num]=y;next[num]=head[x];head[x]=num;cost[num]=z;
     }
void spfa(int st,int *dis){
     for(int i=1;i<=n;i++)dis[i]=INF,vis[i]=0;
     dis[st]=0;vis[st]=1;
     int t=0,w=1;q[1]=st;
     while(t<w){
       int u=q[++t];
       for(int i=head[u];i;i=next[i])
         if(dis[u]+cost[i]<dis[v[i]]){
           dis[v[i]]=dis[u]+cost[i];
           if(!vis[v[i]]){
             q[++w]=v[i];
             vis[v[i]]=1;
           }
         }
       vis[u]=0;
     }
}
int main(){
    scanf("%d%d%d",&n,&m,&k);
    scanf("%d%d%d",&s1,&s2,&ed);
    for(int i=1;i<=m;i++){
      int x,y,z;
      scanf("%d%d%d",&x,&y,&z);
      add(x,y,z);
    }
    for(int i=1;i<=k;i++){
      int x,y;
      scanf("%d%d%d%d",&x,&y,&z1[i],&z2[i]);rec[i]=x;
      add(x,y,z2[i]);pd[i]=1;
    }
    spfa(s1,dis1);
    spfa(s2,dis2);
    for(int i=1;i<=k;i++)
      if(dis1[ed]>=dis2[ed] && pd[i] && dis1[rec[i]]<dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
      }
    if(dis1[ed]<dis2[ed]){
      printf("WIN\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    for(int i=1;i<=k;i++)
      if(dis1[ed]>dis2[ed] && pd[i] && dis1[rec[i]]<=dis2[rec[i]]){
        pd[i]=0;
        swap(z1[i],z2[i]);
        cost[i+m]=z2[i];
        spfa(s1,dis1);
        spfa(s2,dis2);
      }
    if(dis1[ed]<=dis2[ed]){
      printf("DRAW\n");
      for(int i=1;i<=k;i++)printf("%d ",z2[i]);printf("\n");
      return 0;
    }
    printf("LOSE\n");
    return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
const int M=(int)1e4+5;
struct W{
	int to,nx,d;
}Lis[M*4];
int Head1[M],Head2[M],tot;
void Add1(int x,int y,int d){
	Lis[++tot]=(W){y,Head1[x],d};
	Head1[x]=tot;
}
void Add2(int x,int y,int d){
	Lis[++tot]=(W){y,Head2[x],d};
	Head2[x]=tot;
}
int n,m,k,s1,s2,f,l[105],r[105],ans[105];
long long disb[M],dv[M];
int main(){
	scanf("%d %d %d %d %d %d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,x,y,d;i<=m;i++)scanf("%d %d %d",&x,&y,&d),Add1(x,y,d),Add2(y,x,d);
	for(int i=1,x,y;i<=k;i++){
		scanf("%d %d %d %d",&x,&y,&l[i],&r[i]);
		Add1(x,y,r[i]);
		Add2(y,x,-i);
	}
	priority_queue<pair<long long,int> >q;
	q.push(pair<long long,int>(0,s2));
	memset(disb,-1,sizeof(disb));
	disb[s2]=0;
	pair<long long,int>tmp;
	int x;
	long long d,ll;
	while(!q.empty()){
		tmp=q.top();q.pop();
		x=tmp.second,d=-tmp.first;
		if(disb[x]!=d)continue;
		for(int i=Head1[x],to;i&&(to=Lis[i].to,1);i=Lis[i].nx){
			ll=d+Lis[i].d;
			if(ll<disb[to]||disb[to]==-1){
				disb[to]=ll;
				q.push(pair<long long,int>(-ll,to));
			}
		}
	}
	memset(dv,-1,sizeof(dv));
	dv[f]=0;
	q.push(pair<long long,int>(0,f));
	while(!q.empty()){
		tmp=q.top();q.pop();
		x=tmp.second,d=-tmp.first;
		if(dv[x]!=d)continue;
		for(int i=Head2[x],to,vv;i&&(to=Lis[i].to,1);i=Lis[i].nx){
			if(Lis[i].d<0){
				vv=-Lis[i].d;
				if(disb[to]==-1)Lis[i].d=l[-Lis[i].d];
				else Lis[i].d=max(disb[f]-disb[to]-dv[x],(long long)l[-Lis[i].d]);
				ans[vv]=Lis[i].d;
			}
			ll=d+Lis[i].d;
			if(ll<dv[to]||dv[to]==-1){
				dv[to]=ll;
				q.push(pair<long long,int>(-ll,to));
			}
		}
	}
	if(dv[s1]<=dv[s2]){
		if(dv[s1]==dv[s2])puts("DRAW");
		else puts("WIN");
		for(int i=1;i<=k;i++)printf("%d ",ans[i]);putchar('\n');
	}else puts("LOSE");
	return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
const int M=(int)1e4+5;
struct W{
	int to,nx,d;
}Lis[M*4];
int Head1[M],Head2[M],tot;
void Add1(int x,int y,int d){
	Lis[++tot]=(W){y,Head1[x],d};
	Head1[x]=tot;
}
void Add2(int x,int y,int d){
	Lis[++tot]=(W){y,Head2[x],d};
	Head2[x]=tot;
}
int n,m,k,s1,s2,f,l[105],r[105],ans[105];
long long disb[M],dv[M];
int main(){
	scanf("%d %d %d %d %d %d",&n,&m,&k,&s1,&s2,&f);
	for(int i=1,x,y,d;i<=m;i++)scanf("%d %d %d",&x,&y,&d),Add1(x,y,d),Add2(y,x,d);
	for(int i=1,x,y;i<=k;i++){
		scanf("%d %d %d %d",&x,&y,&l[i],&r[i]);
		Add1(x,y,r[i]);
		Add2(y,x,-i);
	}
	priority_queue<pair<long long,int> >q;
	q.push(pair<long long,int>(0,s2));
	memset(disb,-1,sizeof(disb));
	disb[s2]=0;
	pair<long long,int>tmp;
	int x;
	long long d,ll;
	while(!q.empty()){
		tmp=q.top();q.pop();
		x=tmp.second,d=-tmp.first;
		if(disb[x]!=d)continue;
		for(int i=Head1[x],to;i&&(to=Lis[i].to,1);i=Lis[i].nx){
			ll=d+Lis[i].d;
			if(ll<disb[to]||disb[to]==-1){
				disb[to]=ll;
				q.push(pair<long long,int>(-ll,to));
			}
		}
	}
	memset(dv,-1,sizeof(dv));
	dv[f]=0;
	q.push(pair<long long,int>(0,f));
	while(!q.empty()){
		tmp=q.top();q.pop();
		x=tmp.second,d=-tmp.first;
		if(dv[x]!=d)continue;
		for(int i=Head2[x],to,vv;i&&(to=Lis[i].to,1);i=Lis[i].nx){
			if(Lis[i].d<0){
				vv=-Lis[i].d;
				if(disb[to]==-1)Lis[i].d=l[vv];
				else Lis[i].d=max(disb[f]-disb[to]-dv[x],(long long)l[vv]);
				ans[vv]=Lis[i].d;
			}
			ll=d+Lis[i].d;
			if(ll<dv[to]||dv[to]==-1){
				dv[to]=ll;
				q.push(pair<long long,int>(-ll,to));
			}
		}
	}
	if(dv[s1]<=dv[s2]){
		if(dv[s1]==dv[s2])puts("DRAW");
		else puts("WIN");
		for(int i=1;i<=k;i++)
			if(ans[i]!=0)printf("%d ",ans[i]);
			else printf("%d ",r[i]);
		putchar('\n');
	}else puts("LOSE");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define fs first
#define sc second

typedef long long ll;
int v[20010], l[20010], r[20010], c[20010];

vector<int> e[20010];

ll d1[20010], d2[20010];

int main () {
	int n, m, k;
	cin >> n >> m >> k;
	int s1, s2, f;
	cin >> s1 >> s2 >> f;
	s1--;
	s2--;
	f--;
	for(int i = 0; i < m; i ++){
		int x, y, c;
		cin >> x >> y >> c;
		x--;
		y--;
		e[x].pb(i);
		v[i] = y;
		l[i] = r[i] = c;
	}
	for(int i = 0; i < k; i ++) {
		int	x, y, s, t;
		cin >> x >> y >> s >> t;
		x--;
		y--;
		e[x].pb(i + m);
		v[i + m] = y;
		l[i + m] = s;
		r[i + m] = t;
	}
	set<pair<ll, pair<int, int> > > s;
/*	for(int i = 0; i < n; i ++) {
		d1[i] = d2[i] = 1000000000000000000ll;
	}
	d1[s1] = 0;
	d2[s2] = 0;
	for(int i; i < n; i ++) {
		s.insert(mp(d1[i], mp(i, 0)));
		s.insert(mp(d2[i], mp(i, 1)));
	}
	while (s.size()) {
		int q = s.begin()->sc.sc;
		int x = s.begin()->sc.fs;
		s.erase(s.begin());
		for(int i = 0; i < e[x].size(); i ++) {
			int j = e[x][i];
			if (d1[x] < d2[x]) {
				c[j] = l[j];
			} else {
				c[j] = r[j];
			}
			if (q == 0) {
				int to = v[j];
				ll cur = d1[x] + c[j];
				if (d1[to] > cur) {
					s.erase(mp(d1[to], mp(to, 0)));
					d1[to] = cur;
					s.insert(mp(d1[to], mp(to, 0)));
				}
			} else {
				int to = v[j];
				ll cur = d2[x] + c[j];
				if (d2[to] > cur) {
					s.erase(mp(d2[to], mp(to, 1)));
					d2[to] = cur;
					s.insert(mp(d2[to], mp(to, 1)));
				}
			}
		}
	}
	if (d1[f] < d2[f]) {
		puts("WIN");
		for(int i = 0; i < k; i ++) {
			cout << c[m + i] << ' ';
		}
		cout << endl;
		return 0;
	}*/
	for(int i = 0; i < n; i ++) {
		d1[i] = d2[i] = 1000000000000000000ll;
	}
	d1[s1] = 0;
	d2[s2] = 0;
	s.clear();
	for(int i = 0; i < n; i ++) {
		s.insert(mp(d1[i], mp(i, 0)));
		s.insert(mp(d2[i], mp(i, 1)));
	}
	while (s.size()) {
		int q = s.begin()->sc.sc;
		int x = s.begin()->sc.fs;
		s.erase(s.begin());
		for(int i = 0; i < e[x].size(); i ++) {
			int j = e[x][i];
			if (d1[x] <= d2[x]) {
				c[j] = l[j];
			} else {
				c[j] = r[j];
			}
			if (q == 0) {
				int to = v[j];
				ll cur = d1[x] + c[j];
				if (d1[to] > cur) {
					s.erase(mp(d1[to], mp(to, 0)));
					d1[to] = cur;
					s.insert(mp(d1[to], mp(to, 0)));
				}
			} else {
				int to = v[j];
				ll cur = d2[x] + c[j];
				if (d2[to] > cur) {
					s.erase(mp(d2[to], mp(to, 1)));
					d2[to] = cur;
					s.insert(mp(d2[to], mp(to, 1)));
				}
			}
		}
	}
	if (d1[f] <= d2[f]) {
		if(d1[f] == d2[f])puts("DRAW");
		else	puts("WIN");
		for(int i = 0; i < k; i ++) {
			cout << c[m + i] << ' ';
		}
		cout << endl;
		return 0;
	}
	puts("LOSE");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define fs first
#define sc second

typedef long long ll;
int v[20010], l[20010], r[20010], c[20010];

vector<int> e[20010];

ll d1[20010], d2[20010];

int main () {
	int n, m, k;
	cin >> n >> m >> k;
	int s1, s2, f;
	cin >> s1 >> s2 >> f;
	s1--;
	s2--;
	f--;
	for(int i = 0; i < m; i ++){
		int x, y, c;
		cin >> x >> y >> c;
		x--;
		y--;
		e[x].pb(i);
		v[i] = y;
		l[i] = r[i] = c;
	}
	for(int i = 0; i < k; i ++) {
		int	x, y, s, t;
		cin >> x >> y >> s >> t;
		x--;
		y--;
		e[x].pb(i + m);
		v[i + m] = y;
		l[i + m] = s;
		r[i + m] = t;
	}
	for(int i = 0; i < n; i ++) {
		d1[i] = d2[i] = 1000000000000000000ll;
	}
	d1[s1] = 0;
	d2[s2] = 0;
	set<pair<ll, pair<int, int> > > s;
	for(int i; i < n; i ++) {
		s.insert(mp(d1[i], mp(i, 0)));
		s.insert(mp(d2[i], mp(i, 1)));
	}
	while (s.size()) {
		int q = s.begin()->sc.sc;
		int x = s.begin()->sc.fs;
		s.erase(s.begin());
		for(int i = 0; i < e[x].size(); i ++) {
			int j = e[x][i];
			if (d1[x] < d2[x]) {
				c[j] = l[j];
			} else {
				c[j] = r[j];
			}
			if (q == 0) {
				int to = v[j];
				ll cur = d1[x] + c[j];
				if (d1[to] > cur) {
					s.erase(mp(d1[to], mp(to, 0)));
					d1[to] = cur;
					s.insert(mp(d1[to], mp(to, 0)));
				}
			} else {
				int to = v[j];
				ll cur = d2[x] + c[j];
				if (d2[to] > cur) {
					s.erase(mp(d2[to], mp(to, 1)));
					d2[to] = cur;
					s.insert(mp(d2[to], mp(to, 1)));
				}
			}
		}
	}
	if (d1[f] < d2[f]) {
		puts("WIN");
		for(int i = 0; i < k; i ++) {
			cout << c[m + i] << ' ';
		}
		cout << endl;
		return 0;
	}
/*	for(int i = 0; i < n; i ++) {
		d1[i] = d2[i] = 1000000000000000000ll;
	}
	d1[s1] = 0;
	d2[s2] = 0;
	s.clear();
	for(int i = 0; i < n; i ++) {
		s.insert(mp(d1[i], mp(i, 0)));
		s.insert(mp(d2[i], mp(i, 1)));
	}
	while (s.size()) {
		int q = s.begin()->sc.sc;
		int x = s.begin()->sc.fs;
		s.erase(s.begin());
		for(int i = 0; i < e[x].size(); i ++) {
			int j = e[x][i];
			if (d1[x] <= d2[x]) {
				c[j] = l[j];
			} else {
				c[j] = r[j];
			}
			if (q == 0) {
				int to = v[j];
				ll cur = d1[x] + c[j];
				if (d1[to] > cur) {
					s.erase(mp(d1[to], mp(to, 0)));
					d1[to] = cur;
					s.insert(mp(d1[to], mp(to, 0)));
				}
			} else {
				int to = v[j];
				ll cur = d2[x] + c[j];
				if (d2[to] > cur) {
					s.erase(mp(d2[to], mp(to, 1)));
					d2[to] = cur;
					s.insert(mp(d2[to], mp(to, 1)));
				}
			}
		}
	}
	if (d1[f] <= d2[f]) {
		puts("DRAW");
		for(int i = 0; i < k; i ++) {
			cout << c[m + i] << ' ';
		}
		cout << endl;
		return 0;
	}*/
	puts("LOSE");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define fs first
#define sc second

typedef long long ll;
int v[20010], l[20010], r[20010], c[20010];

vector<int> e[20010];

ll d1[20010], d2[20010];

int main () {
	int n, m, k;
	cin >> n >> m >> k;
	int s1, s2, f;
	cin >> s1 >> s2 >> f;
	s1--;
	s2--;
	f--;
	for(int i = 0; i < m; i ++){
		int x, y, c;
		cin >> x >> y >> c;
		x--;
		y--;
		e[x].pb(i);
		v[i] = y;
		l[i] = r[i] = c;
	}
	for(int i = 0; i < k; i ++) {
		int	x, y, s, t;
		cin >> x >> y >> s >> t;
		x--;
		y--;
		e[x].pb(i + m);
		v[i + m] = y;
		l[i + m] = s;
		r[i + m] = t;
	}
	for(int i = 0; i < n; i ++) {
		d1[i] = d2[i] = 1000000000000000000ll;
	}
	d1[s1] = 0;
	d2[s2] = 0;
	set<pair<ll, pair<int, int> > > s;
	for(int i; i < n; i ++) {
		s.insert(mp(d1[i], mp(i, 0)));
		s.insert(mp(d2[i], mp(i, 1)));
	}
	while (s.size()) {
		int q = s.begin()->sc.sc;
		int x = s.begin()->sc.fs;
		s.erase(s.begin());
		for(int i = 0; i < e[x].size(); i ++) {
			int j = e[x][i];
			if (d1[x] < d2[x]) {
				c[j] = l[j];
			} else {
				c[j] = r[j];
			}
			if (q == 0) {
				int to = v[j];
				ll cur = d1[x] + c[j];
				if (d1[to] > cur) {
					s.erase(mp(d1[to], mp(to, 0)));
					d1[to] = cur;
					s.insert(mp(d1[to], mp(to, 0)));
				}
			} else {
				int to = v[j];
				ll cur = d2[x] + c[j];
				if (d2[to] > cur) {
					s.erase(mp(d2[to], mp(to, 1)));
					d2[to] = cur;
					s.insert(mp(d2[to], mp(to, 1)));
				}
			}
		}
	}
	if (d1[f] < d2[f]) {
		puts("WIN");
		for(int i = 0; i < k; i ++) {
			cout << c[m + i] << ' ';
		}
		cout << endl;
		return 0;
	}
	for(int i = 0; i < n; i ++) {
		d1[i] = d2[i] = 1000000000000000000ll;
	}
	d1[s1] = 0;
	d2[s2] = 0;
	s.clear();
	for(int i = 0; i < n; i ++) {
		s.insert(mp(d1[i], mp(i, 0)));
		s.insert(mp(d2[i], mp(i, 1)));
	}
	while (s.size()) {
		int q = s.begin()->sc.sc;
		int x = s.begin()->sc.fs;
		s.erase(s.begin());
		for(int i = 0; i < e[x].size(); i ++) {
			int j = e[x][i];
			if (d1[x] <= d2[x]) {
				c[j] = l[j];
			} else {
				c[j] = r[j];
			}
			if (q == 0) {
				int to = v[j];
				ll cur = d1[x] + c[j];
				if (d1[to] > cur) {
					s.erase(mp(d1[to], mp(to, 0)));
					d1[to] = cur;
					s.insert(mp(d1[to], mp(to, 0)));
				}
			} else {
				int to = v[j];
				ll cur = d2[x] + c[j];
				if (d2[to] > cur) {
					s.erase(mp(d2[to], mp(to, 1)));
					d2[to] = cur;
					s.insert(mp(d2[to], mp(to, 1)));
				}
			}
		}
	}
	if (d1[f] <= d2[f]) {
		puts("DRAW");
		for(int i = 0; i < k; i ++) {
			cout << c[m + i] << ' ';
		}
		cout << endl;
		return 0;
	}
	puts("LOSE");
	return 0;
}


#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define fs first
#define sc second

typedef long long ll;
int v[20010], l[20010], r[20010], c[20010];

vector<int> e[20010];

ll d1[20010], d2[20010];

int main () {
	int n, m, k;
	cin >> n >> m >> k;
	int s1, s2, f;
	cin >> s1 >> s2 >> f;
	s1--;
	s2--;
	f--;
	for(int i = 0; i < m; i ++){
		int x, y, c;
		cin >> x >> y >> c;
		x--;
		y--;
		e[x].pb(i);
		v[i] = y;
		l[i] = r[i] = c;
	}
	for(int i = 0; i < k; i ++) {
		int	x, y, s, t;
		cin >> x >> y >> s >> t;
		x--;
		y--;
		e[x].pb(i + m);
		v[i + m] = y;
		l[i + m] = s;
		r[i + m] = t;
	}
	for(int i = 0; i < n; i ++) {
		d1[i] = d2[i] = 1000000000000000000ll;
	}
	d1[s1] = 0;
	d2[s2] = 0;
	set<pair<ll, pair<int, int> > > s;
	for(int i; i < n; i ++) {
		s.insert(mp(d1[i], mp(i, 0)));
		s.insert(mp(d2[i], mp(i, 1)));
	}
	while (s.size()) {
		int q = s.begin()->sc.sc;
		int x = s.begin()->sc.fs;
		s.erase(s.begin());
		for(int i = 0; i < e[x].size(); i ++) {
			int j = e[x][i];
			if (d1[x] < d2[x]) {
				c[j] = l[j];
			} else {
				c[j] = r[j];
			}
			if (q == 0) {
				int to = v[j];
				ll cur = d1[x] + c[j];
				if (d1[to] > cur) {
					s.erase(mp(d1[to], mp(to, 0)));
					d1[to] = cur;
					s.insert(mp(d1[to], mp(to, 0)));
				}
			} else {
				int to = v[j];
				ll cur = d2[x] + c[j];
				if (d2[to] > cur) {
					s.erase(mp(d2[to], mp(to, 1)));
					d2[to] = cur;
					s.insert(mp(d2[to], mp(to, 1)));
				}
			}
		}
	}
	if (d1[f] < d2[f]) {
		puts("WIN");
		for(int i = 0; i < k; i ++) {
			cout << c[m + i] << ' ';
		}
		cout << endl;
		return 0;
	}
	for(int i = 0; i < n; i ++) {
		d1[i] = d2[i] = 1000000000000000000ll;
	}
	d1[s1] = 0;
	d2[s2] = 0;
	s.clear();
	for(int i = 0; i < n; i ++) {
		s.insert(mp(d1[i], mp(i, 0)));
		s.insert(mp(d2[i], mp(i, 1)));
	}
	while (s.size()) {
		int q = s.begin()->sc.sc;
		int x = s.begin()->sc.fs;
		s.erase(s.begin());
		for(int i = 0; i < e[x].size(); i ++) {
			int j = e[x][i];
			if (d1[x] <= d2[x]) {
				c[j] = l[j];
			} else {
				c[j] = r[j];
			}
			if (q == 0) {
				int to = v[j];
				ll cur = d1[x] + c[j];
				if (d1[to] > cur) {
					s.erase(mp(d1[to], mp(to, 0)));
					d1[to] = cur;
					s.insert(mp(d1[to], mp(to, 0)));
				}
			} else {
				int to = v[j];
				ll cur = d2[x] + c[j];
				if (d2[to] > cur) {
					s.erase(mp(d2[to], mp(to, 1)));
					d2[to] = cur;
					s.insert(mp(d2[to], mp(to, 1)));
				}
			}
		}
	}
	if (d1[f] <= d2[f]) {
		puts("DRAW");
		for(int i = 0; i < k; i ++) {
			cout << c[m + i] << ' ';
		}
		cout << endl;
		return 0;
	}
	puts("LOSE");
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
using namespace std;
typedef long long LL;
template<class T> inline bool ten(T &x,const T &y){return y<x?(x=y,1):0;}
template<class T> inline bool rel(T &x,const T &y){return x<y?(x=y,1):0;}
const int maxn=10005;
int n,m,k,S1,S2,F;
int cur[maxn],U[maxn],V[maxn],L[maxn],R[maxn];
LL d1[maxn],d2[maxn];

int head[maxn],adj[maxn*2],c[maxn*2],next[maxn*2],tot;

struct state
{
	int id;
	LL dis;
	state(const int &_id=0,const LL &_dis=0):id(_id),dis(_dis){}
	bool operator<(const state &o)const
	{return dis>o.dis;}
};
inline int addedge(int u,int v,int w)
{return tot++,adj[tot]=v,c[tot]=w,next[tot]=head[u],head[u]=tot,tot;}

void init()
{
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d",&S1,&S2,&F);
	for(int i=1,u,v,w;i<=m;i++)
		scanf("%d%d%d",&u,&v,&w),addedge(u,v,w);
	for(int i=1;i<=k;i++)
		scanf("%d%d%d%d",U+i,V+i,L+i,R+i),cur[i]=addedge(U[i],V[i],R[i]);
}

void dijkstra(int S,LL *d)
{
	priority_queue<state> Q;
	memset(d,31,n+1<<3);
	d[S]=0;
	Q.push(state(S,0));
	LL t;
	for(int u,v,i;!Q.empty();)
	{
		u=Q.top().id,t=Q.top().dis,Q.pop();
		if(d[u]==t)
			for(i=head[u];i;i=next[i])
				if(ten(d[v=adj[i]],t+c[i]))
					Q.push(state(v,d[v]));
	}
}

bool work()
{
	dijkstra(S1,d1);
	dijkstra(S2,d2);
	bool flag=0;
	for(int i=1;i<=k;i++)
		if(d1[U[i]]<d2[U[i]]&&c[cur[i]]>L[i])c[cur[i]]=L[i],flag=1;
	return flag;
}

int main()
{
	init();
	while(work());
	if(d1[F]>d2[F])puts("LOSE");
	else
	{
		puts(d1[F]<d2[F]?"WIN":"DRAW");
		for(int i=1;i<=k;i++)
			printf("%d%c",c[cur[i]]," \n"[i==k]);
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<time.h>
#include<math.h>
#include<algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<set>
#include<queue>
using namespace std;
typedef long long lld;
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define maxn 100010
struct Edge
{
    int v,l,r,next;
}edge[100010];
int head[maxn];
int pos;
void insert(int x,int y,int l,int r)
{
    edge[pos].v=y;
    edge[pos].l=l;
    edge[pos].r=r;
    edge[pos].next=head[x];
    head[x]=pos++;
}
struct Node
{
    lld s;
    int id;
    Node(){}
    Node(lld s0,int id0):s(s0),id(id0){}
    bool operator <(Node a) const
    {
        return a.s < s;
    }
};
#define inf (1LL)<<60
int n;
lld dis1[maxn];
lld dis2[maxn];
int s1,s2,end;
priority_queue<Node>Q;
int ans[maxn];
void spfa(bool win)
{
    while(!Q.empty())
        Q.pop();
    for(int i=1;i<=n;i++)
        dis1[i]=dis2[i]=inf;
    dis1[s1]=0;
    dis2[s2]=0;
    Q.push(Node(0,s1));
    Q.push(Node(0,s2));
    while(!Q.empty())
    {
        Node o=Q.top();
        Q.pop();
        int x=o.id;
        if(min(dis1[x],dis2[x]) != o.s)
            continue;
        bool flag;
        if(win)
        {
            if(dis1[x] < dis2[x])
                flag=true;
            else
                flag=false;
        }
        else
        {
            if(dis1[x] <= dis2[x])
                flag=true;
            else
                flag=false;
        }
        for(int i=head[x];i;i=edge[i].next)
        {
            int y=edge[i].v;
            lld add;
            if(flag)
                add=edge[i].l;
            else
                add=edge[i].r;
            ans[i]=add;
            bool doing=false;
            if(dis1[x]+add < dis1[y])
            {
                dis1[y]=dis1[x]+add;
                doing=true;
            }
            if(dis2[x]+add < dis2[y])
            {
                dis2[y]=dis2[x]+add;
                doing=true;
            }
            if(doing)
                Q.push(Node(min(dis1[y],dis2[y]),y));
        }
    }
}
int main()
{
    int m,k;
    scanf("%d %d %d",&n,&m,&k);
    scanf("%d %d %d",&s1,&s2,&end);
    memset(head,0,sizeof(head));
    pos=1;
    for(int i=0;i<m;i++)
    {
        int x,y,s;
        scanf("%d %d %d",&x,&y,&s);
        insert(x,y,s,s);
    }
    int S=pos;
    for(int i=0;i<k;i++)
    {
        int x,y,l,r;
        scanf("%d %d %d %d",&x,&y,&l,&r);
        insert(x,y,l,r);
    }
    spfa(true);
    if(dis1[end] < dis2[end])
    {
        printf("WIN\n");
        for(int i=S;i<pos;i++)
            printf("%d ",ans[i]);
        printf("\n");
        return 0;
    }
    spfa(false);
    if(dis1[end] <= dis2[end])
    {
        printf("DRAW\n");
        for(int i=S;i<pos;i++)
            printf("%d ",ans[i]);
        printf("\n");
        return 0;
    }
    printf("LOSE\n");
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<time.h>
#include<math.h>
#include<algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<set>
#include<queue>
using namespace std;
typedef long long lld;
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define maxn 100010
struct Edge
{
    int v,l,r,next;
}edge[100010];
int head[maxn];
int pos;
void insert(int x,int y,int l,int r)
{
    edge[pos].v=y;
    edge[pos].l=l;
    edge[pos].r=r;
    edge[pos].next=head[x];
    head[x]=pos++;
}
struct Node
{
    lld s;
    int id;
    Node(){}
    Node(lld s0,int id0):s(s0),id(id0){}
    bool operator <(Node a) const
    {
        return a.s < s;
    }
};
#define inf (1LL)<<60
int n;
lld dis1[maxn];
lld dis2[maxn];
int s1,s2,end;
priority_queue<Node>Q;
int ans[maxn];
void spfa(bool win)
{
    while(!Q.empty())
        Q.pop();
    for(int i=1;i<=n;i++)
        dis1[i]=dis2[i]=inf;
    dis1[s1]=0;
    dis2[s2]=0;
    Q.push(Node(0,s1));
    Q.push(Node(0,s2));
    while(!Q.empty())
    {
        Node o=Q.top();
        Q.pop();
        int x=o.id;
        if(min(dis1[x],dis2[x]) != o.s)
            continue;
        bool flag;
        if(win)
        {
            if(dis1[x] < dis2[x])
                flag=true;
            else
                flag=false;
        }
        else
        {
            if(dis1[x] <= dis2[x])
                flag=true;
            else
                flag=false;
        }
        for(int i=head[x];i;i=edge[i].next)
        {
            int y=edge[i].v;
            lld add;
            if(flag)
                add=edge[i].l;
            else
                add=edge[i].r;
            ans[i]=add;
            bool doing=false;
            if(dis1[x]+add < dis1[y])
            {
                dis1[y]=dis1[x]+add;
                doing=true;
            }
            if(dis2[x]+add < dis2[y])
            {
                dis2[y]=dis2[x]+add;
                doing=true;
            }
            if(doing)
                Q.push(Node(min(dis1[y],dis2[y]),y));
        }
    }
}
int main()
{
    int m,k;
    scanf("%d %d %d",&n,&m,&k);
    scanf("%d %d %d",&s1,&s2,&end);
    memset(head,0,sizeof(head));
    pos=1;
    for(int i=0;i<m;i++)
    {
        int x,y,s;
        scanf("%d %d %d",&x,&y,&s);
        insert(x,y,s,s);
    }
    int S=pos;
    for(int i=0;i<k;i++)
    {
        int x,y,l,r;
        scanf("%d %d %d %d",&x,&y,&l,&r);
        insert(x,y,l,r);
    }
    memset(ans,-1,sizeof(ans));
    spfa(true);
    if(dis1[end] < dis2[end])
    {
        printf("WIN\n");
        for(int i=S;i<pos;i++)
        {
            if(ans[i] == -1)
                ans[i]=edge[i].l;
            printf("%d ",ans[i]);
        }
        printf("\n");
        return 0;
    }
    spfa(false);
    if(dis1[end] <= dis2[end])
    {
        printf("DRAW\n");
        for(int i=S;i<pos;i++)
        {
            if(ans[i] == -1)
                ans[i]=edge[i].l;
            printf("%d ",ans[i]);
        }
        printf("\n");
        return 0;
    }
    printf("LOSE\n");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;
int get()
{
	int f=0,v=0;char ch;
	while(!isdigit(ch=getchar()))if(ch=='-')break;
	if(ch=='-')f=1;else v=ch-'0';
	while(isdigit(ch=getchar()))v=v*10+ch-'0';
	if(f)return -v;else return v;
}
typedef long long LL;
const int maxn=10233;
bool vis[maxn];
int Link[maxn],t[maxn],pre[maxn],v[maxn],A,B,T,s[maxn],K,st[maxn],len[maxn],tot=0,n,m;
LL distA[maxn],distB[maxn];
inline void add(int x,int y,int z)
{
	pre[++tot]=Link[x]; Link[x]=tot; t[tot]=y; v[tot]=z;
}
void spfa(LL *dist,int S)
{
	for(int i=1;i<=n;i++)dist[i]=1e16,vis[i]=0;
	int front=0,rear=1;
	s[front]=S,dist[S]=0,vis[S]=1;
	while(front!=rear)
	{
		int p=s[front++];
		if(front==maxn)front=0;
		vis[p]=0;
		for(int i=Link[p];i;i=pre[i])
			if(dist[t[i]]>dist[p]+v[i])
			{
				dist[t[i]]=dist[p]+v[i];
				if(!vis[t[i]])
				{
					vis[t[i]]=1;
					s[rear++]=t[i];
					if(rear==maxn)rear=0;
				}
			}
	}
}

void work(int f)
{
	for(bool g=1;g;)
	{
		g=0;
		for(int i=1;i<=K;i++)
			if(distA[st[i]]<distB[st[i]]+f&&v[i+m]!=len[i])g=1,v[i+m]=len[i];
		spfa(distA,A),spfa(distB,B);
		if(distA[T]<distB[T]+f)
		{
			puts(f?"DRAW":"WIN");
			for(int i=1;i<=K;i++)printf("%d ",v[i+m]);
			exit(0);
		}
	}
}

int main()
{
	n=get(),m=get();K=get();
	A=get(),B=get(),T=get();
	for(int i=1,x,y;i<=m;i++)x=get(),y=get(),add(x,y,get());
	for(int i=1,y,z;i<=K;i++)
		st[i]=get(),y=get(),len[i]=get(),z=get(),add(st[i],y,z);
	spfa(distA,A),spfa(distB,B);
	work(0),work(1);
	return puts("LOSE"),0;
}


#include <stdio.h>
#include <stdlib.h>
using namespace std;

int n,m,K,i,j,k,u,v,c,cc,tot,S1,S2,T,ll,rr;
int son[10005],from[20005],next[20005],ed[20005],cost[20005],costt[20005];
int q[100005],p[10005];
bool inq[10005];
long long dist[10005],d;

int main()
{
	scanf("%d%d%d",&n,&m,&K);
	scanf("%d%d%d",&S1,&S2,&T);
	for(i=1;i<=m;++i)
	{
		scanf("%d%d%d",&u,&v,&c);
		++tot;from[tot]=u;next[tot]=son[u];son[u]=tot;ed[tot]=v;cost[tot]=c;
	}
	for(i=1;i<=K;++i)
	{
		scanf("%d%d%d%d",&u,&v,&c,&cc);
		++tot;from[tot]=u;next[tot]=son[u];son[u]=tot;ed[tot]=v;cost[tot]=c;costt[tot]=cc;
	}
	for(i=1;i<=n;++i)dist[i]=100000000000000ll;
	dist[S1]=0;p[S1]|=1;q[++rr]=S1;inq[S1]=true;
	dist[S2]=0;p[S2]|=2;q[++rr]=S2;inq[S2]=true;
	while(ll!=rr)
	{
		++ll;if(ll==100000)ll=1;
		u=q[ll];inq[u]=false;
		for(i=son[u];i;i=next[i])
		{
			if(i>m&&p[u]/2)d=dist[u]+costt[i];
			else d=dist[u]+cost[i];
			if(d<dist[ed[i]]||(d<=dist[ed[i]]&&p[u]!=p[ed[i]]))
			{
				if(d==dist[ed[i]])p[ed[i]]|=p[u];
				else p[ed[i]]=p[u];
				dist[ed[i]]=d;
				if(!inq[ed[i]])
				{
					inq[ed[i]]=true;
					++rr;if(rr==100000)rr=1;
					q[rr]=ed[i];
				}
			}
		}
	}
	if(p[T]==1)printf("WIN\n");
	if(p[T]==2)printf("LOSE\n");
	if(p[T]==3)printf("DRAW\n");
	if(p[T]!=2)
	{
		for(i=m+1;i<=m+K;++i)
		if(p[from[i]]/2)printf("%d ",costt[i]);
		else printf("%d ",cost[i]);
		printf("\n");
	}
}


#include <cstdio>
using namespace std;
const int N=10004,M=20004;
int n,m,K,s1,s2,f,q[1000004],ans[M],state[N];
int E,first[N],next[M],des[M],dl[M],dr[M],num[M];
long long dis[N];
bool inqueue[N];
void add(int u,int v,int w1,int w2,int p)
{
	next[++E]=first[u]; first[u]=E;
	des[E]=v; dl[E]=w1; dr[E]=w2; num[E]=p;
}
void bfs()
{
	int head=1,tail=2,i;
	if (s1==s2)
	{
		printf("DRAW\n");
		for (i=1;i<=K;i++) printf("%d",ans[i]),putchar((i==K)?'\n':' ');
		return;
	}
	q[1]=s1; state[s1]=1; q[2]=s2; state[s2]=2;
	for (i=1;i<=n;i++) dis[i]=1000000000000000000LL,inqueue[i]=false;
	inqueue[s1]=inqueue[s2]=true; dis[s1]=dis[s2]=0;
	while (head<=tail)
	{
		int u=q[head++]; inqueue[u]=false;
		for (i=first[u];i;i=next[i])
		{
			int v=des[i],w=ans[num[i]]=(state[u]==1)?dl[i]:dr[i];
			if (dis[u]+w<dis[v])
			{
				dis[v]=dis[u]+w; state[v]=state[u];
				if (!inqueue[v]) inqueue[v]=true,q[++tail]=v;
			}
			else if (dis[u]+w==dis[v])
			{
				if ((state[u])&&(state[u]==state[v])) continue;
				state[v]=0;
			}
		}
	}
	if (state[f]<2)
	{
		if (state[f]) printf("WIN\n"); else printf("DRAW\n");
		for (i=1;i<=K;i++) printf("%d",ans[i]),putchar((i==K)?'\n':' ');
	}
	else printf("LOSE\n");
}
int main()
{
	int i; scanf("%d%d%d%d%d%d",&n,&m,&K,&s1,&s2,&f);
	E=0; for (i=1;i<=n;i++) first[i]=0;
	for (i=1;i<=m;i++)
	{
		int u,v,w; scanf("%d%d%d",&u,&v,&w);
		add(u,v,w,w,0);
	}
	for (i=1;i<=K;i++)
	{
		int u,v,w1,w2; scanf("%d%d%d%d",&u,&v,&w1,&w2);
		add(u,v,w1,w2,i);
		ans[i]=w2;
	}
	bfs();
	return 0;
}


#include <cstdio>
using namespace std;
const int N=10004,M=20004;
int n,m,K,s1,s2,f,q[1000004],ans[M],state[N];
int E,first[N],next[M],des[M],dl[M],dr[M],num[M];
long long dis[N];
bool inqueue[N];
void add(int u,int v,int w1,int w2,int p)
{
	next[++E]=first[u]; first[u]=E;
	des[E]=v; dl[E]=w1; dr[E]=w2; num[E]=p;
}
void bfs()
{
	int head=1,tail=2,i;
	q[1]=s1; state[s1]=1; q[2]=s2; state[s2]=2;
	for (i=1;i<=n;i++) dis[i]=1000000000000000000LL,inqueue[i]=false;
	inqueue[s1]=inqueue[s2]=true; dis[s1]=dis[s2]=0;
	while (head<=tail)
	{
		int u=q[head++];
		for (i=first[u];i;i=next[i])
		{
			int v=des[i],w=ans[num[i]]=(state[u]==1)?dl[i]:dr[i];
			if (dis[u]+w<dis[v])
			{
				dis[v]=dis[u]+w; state[v]=state[u];
				if (!inqueue[v]) inqueue[v]=true,q[++tail]=v;
			}
			else if (dis[u]+w==dis[v])
			{
				if ((state[u])&&(state[u]==state[v])) continue;
				state[v]=0;
			}
		}
	}
	if (state[f]<2)
	{
		if (state[f]) printf("WIN\n"); else printf("DRAW\n");
		for (i=1;i<=K;i++)
		{
			printf("%d",ans[i]);
			putchar((i==K)?'\n':' ');
		}
	}
	else printf("LOSE\n");
}
int main()
{
	int i; scanf("%d%d%d%d%d%d",&n,&m,&K,&s1,&s2,&f);
	E=0; for (i=1;i<=n;i++) first[i]=0;
	for (i=1;i<=m;i++)
	{
		int u,v,w; scanf("%d%d%d",&u,&v,&w);
		add(u,v,w,w,0);
	}
	for (i=1;i<=K;i++)
	{
		int u,v,w1,w2; scanf("%d%d%d%d",&u,&v,&w1,&w2);
		add(u,v,w1,w2,i);
		ans[i]=w2;
	}
	bfs();
	return 0;
}


#include <cstdio>
using namespace std;
const int N=10004,M=20004;
int n,m,K,s1,s2,f,q[1000004],ans[M],state[N];
int E,first[N],next[M],des[M],dl[M],dr[M],num[M];
long long dis[N];
bool inqueue[N];
void add(int u,int v,int w1,int w2,int p)
{
	next[++E]=first[u]; first[u]=E;
	des[E]=v; dl[E]=w1; dr[E]=w2; num[E]=p;
}
void bfs()
{
	int head=1,tail=2,i;
	q[1]=s1; state[s1]=1; q[2]=s2; state[s2]=2;
	for (i=1;i<=n;i++) dis[i]=1000000000000000000LL,inqueue[i]=false;
	inqueue[s1]=inqueue[s2]=true; dis[s1]=dis[s2]=0;
	while (head<=tail)
	{
		int u=q[head++]; inqueue[u]=false;
		for (i=first[u];i;i=next[i])
		{
			int v=des[i],w=ans[num[i]]=(state[u]==1)?dl[i]:dr[i];
			if (dis[u]+w<dis[v])
			{
				dis[v]=dis[u]+w; state[v]=state[u];
				if (!inqueue[v]) inqueue[v]=true,q[++tail]=v;
			}
			else if (dis[u]+w==dis[v])
			{
				if ((state[u])&&(state[u]==state[v])) continue;
				state[v]=0;
			}
		}
	}
	if (state[f]<2)
	{
		if (state[f]) printf("WIN\n"); else printf("DRAW\n");
		for (i=1;i<=K;i++)
		{
			printf("%d",ans[i]);
			putchar((i==K)?'\n':' ');
		}
	}
	else printf("LOSE\n");
}
int main()
{
	int i; scanf("%d%d%d%d%d%d",&n,&m,&K,&s1,&s2,&f);
	E=0; for (i=1;i<=n;i++) first[i]=0;
	for (i=1;i<=m;i++)
	{
		int u,v,w; scanf("%d%d%d",&u,&v,&w);
		add(u,v,w,w,0);
	}
	for (i=1;i<=K;i++)
	{
		int u,v,w1,w2; scanf("%d%d%d%d",&u,&v,&w1,&w2);
		add(u,v,w1,w2,i);
		ans[i]=w2;
	}
	bfs();
	return 0;
}


#include <cstdio>
#include <algorithm>
#include <cstring>
#define FOR(i,j,k) for(i=j;i<=k;i++)
int read() {
	int s=0,f=1;char ch=getchar();
	for(;ch<'0'||ch>'9';ch=getchar())if(ch=='-')f=-1;
	for(;'0'<=ch&&ch<='9';ch=getchar())s=s*10+ch-'0';
	return s*f;
}
typedef long long ll;
const int N = 10001, M = 20001;
ll da[N], db[N], el[M], er[M];
int n, m, k, s1, s2, t;
int head[N], next[M], from[M], to[M], q[N * 64], cnt = 0;
bool vis[N];
void add(int u, int v, int l, int r) {
	next[++cnt] = head[u]; from[cnt] = u; to[cnt] = v;
	el[cnt] = l; er[cnt] = r; head[u] = cnt;
}
void spfa(ll dis[N], int s) {
	memset(dis, 0x7f, sizeof(ll)*N);
	memset(vis, 0, sizeof vis);
	int f = 0, r = 0, i, u;
	q[r++] = s; dis[s] = 0; vis[s] = 1;
	while (f < r) {
		u = q[f++];
		for (i = head[u]; i; i = next[i]) {
			if (dis[to[i]] > dis[u] + er[i]) {
				dis[to[i]] = dis[u] + er[i];
				if (!vis[to[i]]) {q[r++] = to[i];vis[to[i]] = 1;}
			}
		}
		vis[u] = 0;
	}
}
bool check(int f) {
	int flag = 1, i;
	while (flag) {
		flag = 0;spfa(da, s1); spfa(db, s2);
		FOR(i,m+1,m+k) if(da[from[i]]<db[from[i]] + f && el[i] != er[i]) er[i] = el[i], flag = 1;
		if (da[t]<db[t]+f) {
			puts(f?"DRAW":"WIN");
			FOR(i,m+1,m+k) printf("%d ",er[i]);
			return 1;
		}
	}
	return 0;
}
int main() {
	n = read(), m = read(), k = read();
	s1 = read(), s2 = read(), t = read();
	int i,x,y,z,l,r;
	FOR(i,1,m) x=read(),y=read(),z=read(),add(x,y,z,z);
	FOR(i,1,k) x=read(),y=read(),l=read(),r=read(),add(x,y,l,r);
	if(!check(0)) if(!check(1)) puts("LOSE");
}


#include <stdio.h>
#include <vector>

#define ll long long

using namespace std;

struct sEdge {
    ll L, R;
    int id, v;
};

vector<sEdge> neigh[10009];

ll dist[10009];

int Heap[10009];
int HeapSize = 0;
int posInHeap[10009];

int Pop()
{
    int ans = Heap[1];
    Heap[1] = Heap[HeapSize--];
    int cur = 1;
    while (true) {
        int b = cur;
        if (cur*2 <= HeapSize && dist[ Heap[cur*2] ] <= dist[ Heap[b] ])
            b = cur*2;
        if (cur*2+1 <= HeapSize && dist[ Heap[cur*2+1] ] <= dist[ Heap[b] ])
            b = cur*2+1;
        if (b == cur) break;

        int tmp = Heap[b];
        Heap[b] = Heap[cur];
        Heap[cur] = tmp;

        posInHeap[ Heap[cur] ] = cur;
        posInHeap[ Heap[b] ] = b;
        cur = b;
    }
    return ans;
}

void Upd(int cur)
{
    while (cur > 1 && dist[ Heap[cur] ] <= dist[ Heap[cur/2] ]) {
        int tmp = Heap[cur];
        Heap[cur] = Heap[cur/2];
        Heap[cur/2] = tmp;

        posInHeap[ Heap[cur] ] = cur;
        posInHeap[ Heap[cur/2] ] = cur/2;
        cur /= 2;
    }
}

int ans[109];
int type[10009];

int main()
{
    int n, m, k;
    scanf("%d %d %d", &n, &m, &k);

    int s1, s2, f;
    scanf("%d %d %d", &s1, &s2, &f);

    for (int i = 0; i < m; i++) {
        sEdge tmp;
        int u, v;
        ll c;
        scanf("%d %d %I64d", &u, &v, &c);
        tmp.id = 0;
        tmp.L = tmp.R = c;
        tmp.v = v;
        neigh[u].push_back(tmp);
    }

    for (int i = 1; i <= k; i++) {
        sEdge tmp;
        int u, v;
        scanf("%d %d %I64d %I64d", &u, &v, &tmp.L, &tmp.R);
        tmp.id = i;
        tmp.v = v;
        neigh[u].push_back(tmp);
        ans[i] = tmp.R;
    }

    Heap[++HeapSize] = s1; posInHeap[s1] = HeapSize;
    Heap[++HeapSize] = s2; posInHeap[s2] = HeapSize;

    for (int i = 1; i <= n; i++) {
        if (i == s1 || i == s2) continue;
        Heap[++HeapSize] = i;
        posInHeap[i] = HeapSize;
        dist[i] = 100000000000000000LL;
    }

    type[s1] = 1;
    type[s2] = 2;

    while (HeapSize) {
        int cur = Pop();
        if (dist[cur] == 100000000000000000LL) break;

        if (type[cur] == 0) {
            printf("--");
            return 0;
        }

        for (int i = 0; i < neigh[cur].size(); i++) {
            int u = neigh[cur][i].v;
            if (type[cur] == 1) {
                if (dist[u] > dist[cur] + neigh[cur][i].L) {
                    dist[u] = dist[cur] + neigh[cur][i].L;
                    type[u] = 1;
                    if (neigh[cur][i].id)
                        ans[ neigh[cur][i].id ] = neigh[cur][i].L;
                    Upd(posInHeap[u]);
                }
            }
            else {
                if (dist[u] >= dist[cur] + neigh[cur][i].R) {
                    dist[u]  = dist[cur] + neigh[cur][i].R;
                    type[u] = 2;
                    if (neigh[cur][i].id)
                        ans[ neigh[cur][i].id ] = neigh[cur][i].R;
                    Upd(posInHeap[u]);
                }
            }

        }
    }
    HeapSize = 0;

    if (type[f] == 1) {
        printf("WIN\n");
        for (int i = 1; i <= k; i++) printf("%d ", ans[i]);
        return 0;
    }

    Heap[++HeapSize] = s1; posInHeap[s1] = HeapSize;
    Heap[++HeapSize] = s2; posInHeap[s2] = HeapSize;

    for (int i = 1; i <= n; i++) {
        if (i == s1 || i == s2) continue;
        Heap[++HeapSize] = i;
        posInHeap[i] = HeapSize;
        dist[i] = 100000000000000000LL;
    }

    type[s2] = 2;
    type[s1] = 1;

    while (HeapSize) {
        int cur = Pop();
        if (dist[cur] == 100000000000000000LL) break;

        for (int i = 0; i < neigh[cur].size(); i++) {
            int u = neigh[cur][i].v;
            if (type[cur] == 1) {
                if (dist[u] >= dist[cur] + neigh[cur][i].L) {
                    dist[u]  = dist[cur] + neigh[cur][i].L;
                    type[u] = 1;
                    if (neigh[cur][i].id)
                        ans[ neigh[cur][i].id ] = neigh[cur][i].L;
                    Upd(posInHeap[u]);
                }
            }
            else {
                if (dist[u] > dist[cur] + neigh[cur][i].R) {
                    dist[u] = dist[cur] + neigh[cur][i].R;
                    type[u] = 2;
                    if (neigh[cur][i].id)
                        ans[ neigh[cur][i].id ] = neigh[cur][i].R;
                    Upd(posInHeap[u]);
                }
            }

        }
    }

    if (type[f] == 1) {
        printf("DRAW\n");
        for (int i = 1; i <= k; i++) printf("%d ", ans[i]);
        return 0;
    }

    printf("LOSE");
}


#include <stdio.h>
#include <vector>

#define ll long long

using namespace std;

struct sEdge {
    ll L, R;
    int id, v;
};

vector<sEdge> neigh[10009];

ll dist[10009];

int Heap[10009];
int HeapSize = 0;
int posInHeap[10009];

int Pop()
{
    int ans = Heap[1];
    Heap[1] = Heap[HeapSize--];
    int cur = 1;
    while (true) {
        int b = cur;
        if (cur*2 <= HeapSize && dist[ Heap[cur*2] ] <= dist[ Heap[b] ])
            b = cur*2;
        if (cur*2+1 <= HeapSize && dist[ Heap[cur*2+1] ] <= dist[ Heap[b] ])
            b = cur*2+1;
        if (b == cur) break;

        int tmp = Heap[b];
        Heap[b] = Heap[cur];
        Heap[cur] = tmp;

        posInHeap[ Heap[cur] ] = cur;
        posInHeap[ Heap[b] ] = b;
        cur = b;
    }
    return ans;
}

void Upd(int cur)
{
    while (cur > 1 && dist[ Heap[cur] ] <= dist[ Heap[cur/2] ]) {
        int tmp = Heap[cur];
        Heap[cur] = Heap[cur/2];
        Heap[cur/2] = tmp;

        posInHeap[ Heap[cur] ] = cur;
        posInHeap[ Heap[cur/2] ] = cur/2;
        cur /= 2;
    }
}

int ans[109];
int type[10009];

int main()
{
    int n, m, k;
    scanf("%d %d %d", &n, &m, &k);

    int s1, s2, f;
    scanf("%d %d %d", &s1, &s2, &f);

    for (int i = 0; i < m; i++) {
        sEdge tmp;
        int u, v;
        ll c;
        scanf("%d %d %I64d", &u, &v, &c);
        tmp.id = 0;
        tmp.L = tmp.R = c;
        tmp.v = v;
        neigh[u].push_back(tmp);
        tmp.v = u;
        neigh[v].push_back(tmp);
    }

    for (int i = 1; i <= k; i++) {
        sEdge tmp;
        int u, v;
        scanf("%d %d %I64d %I64d", &u, &v, &tmp.L, &tmp.R);
        tmp.id = i;
        tmp.v = v;
        neigh[u].push_back(tmp);
        tmp.v = u;
        neigh[v].push_back(tmp);
        ans[i] = tmp.R;
    }

    Heap[++HeapSize] = s1; posInHeap[s1] = HeapSize;
    Heap[++HeapSize] = s2; posInHeap[s2] = HeapSize;

    for (int i = 1; i <= n; i++) {
        if (i == s1 || i == s2) continue;
        Heap[++HeapSize] = i;
        posInHeap[i] = HeapSize;
        dist[i] = 100000000000000000LL;
    }

    type[s1] = 1;
    type[s2] = 2;

    while (HeapSize) {
        int cur = Pop();
        if (dist[cur] == 100000000000000000LL) break;

        if (type[cur] == 0) {
            printf("--");
            return 0;
        }

        for (int i = 0; i < neigh[cur].size(); i++) {
            int u = neigh[cur][i].v;
            if (type[cur] == 1) {
                if (dist[u] > dist[cur] + neigh[cur][i].L) {
                    dist[u] = dist[cur] + neigh[cur][i].L;
                    type[u] = 1;
                    if (neigh[cur][i].id)
                        ans[ neigh[cur][i].id ] = neigh[cur][i].L;
                    Upd(posInHeap[u]);
                }
            }
            else {
                if (dist[u] >= dist[cur] + neigh[cur][i].R) {
                    dist[u]  = dist[cur] + neigh[cur][i].R;
                    type[u] = 2;
                    if (neigh[cur][i].id)
                        ans[ neigh[cur][i].id ] = neigh[cur][i].R;
                    Upd(posInHeap[u]);
                }
            }

        }
    }
    HeapSize = 0;

    if (type[f] == 1) {
        printf("WIN\n");
        for (int i = 1; i <= k; i++) printf("%d ", ans[i]);
        return 0;
    }

    Heap[++HeapSize] = s1; posInHeap[s1] = HeapSize;
    Heap[++HeapSize] = s2; posInHeap[s2] = HeapSize;

    for (int i = 1; i <= n; i++) {
        if (i == s1 || i == s2) continue;
        Heap[++HeapSize] = i;
        posInHeap[i] = HeapSize;
        dist[i] = 100000000000000000LL;
    }

    type[s2] = 2;
    type[s1] = 1;

    while (HeapSize) {
        int cur = Pop();
        if (dist[cur] == 100000000000000000LL) break;

        for (int i = 0; i < neigh[cur].size(); i++) {
            int u = neigh[cur][i].v;
            if (type[cur] == 1) {
                if (dist[u] >= dist[cur] + neigh[cur][i].L) {
                    dist[u]  = dist[cur] + neigh[cur][i].L;
                    type[u] = 1;
                    if (neigh[cur][i].id)
                        ans[ neigh[cur][i].id ] = neigh[cur][i].L;
                    Upd(posInHeap[u]);
                }
            }
            else {
                if (dist[u] > dist[cur] + neigh[cur][i].R) {
                    dist[u] = dist[cur] + neigh[cur][i].R;
                    type[u] = 2;
                    if (neigh[cur][i].id)
                        ans[ neigh[cur][i].id ] = neigh[cur][i].R;
                    Upd(posInHeap[u]);
                }
            }

        }
    }

    if (type[f] == 1) {
        printf("DRAW\n");
        for (int i = 1; i <= k; i++) printf("%d ", ans[i]);
        return 0;
    }

    printf("LOSE");
}