#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

const int MAXN = 10005;
const int MAXK = 205;
const ll INF = 0x3f3f3f3fll;
const char msg[5][5] = {"WIN", "DRAW", "LOSE"};

int N, M, K;
int s1, s2, f;
int u[MAXK], v[MAXK], l[MAXK], r[MAXK];
vector <pii> E[MAXN];
vector <int> spec;
ll dist[MAXN];
bool bio[MAXN];
ll graph[MAXK][MAXK], ngraph[MAXK][MAXK];
int idx[MAXN];
int dad[MAXK];
bool bad[MAXK];
ll to[MAXK];
bool in[MAXK];
ll sol = -INF;

struct cmp {
    bool operator()(const int &lhs, const int &rhs) const {
        if (dist[lhs] != dist[rhs])
            return dist[lhs] < dist[rhs];
        return lhs < rhs;
    }
};

void load() {
    scanf("%d%d%d", &N, &M, &K);
    scanf("%d%d%d", &s1, &s2, &f);
    while (M--) {
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);
        E[b].push_back(pii(a, c));
    }
    for (int i = 0; i < K; i++)
        scanf("%d%d%d%d", u + i, v + i, l + i, r + i);
}

void dijkstra(int node) {
    memset(dist, INF, sizeof dist);
    memset(bio, false, sizeof bio);
    dist[node] = 0;
    set <int, cmp> S;
    for (int i = 1; i <= N; i++)
        S.insert(i);

    while (!S.empty()) {
        int x = *S.begin();
        S.erase(x);
        bio[x] = true;
        for (int i = 0; i < E[x].size(); i++) {
            int nxt = E[x][i].first;
            if (bio[nxt]) continue;
            ll cand = dist[x] + E[x][i].second;
            if (cand < dist[nxt]) {
                S.erase(nxt);
                dist[nxt] = cand;
                S.insert(nxt);
            }
        }
    }

    //if (node == 3)
    //    printf("dist to s1 %I64d\n", dist[1]);

    for (int i = 1; i <= N; i++)
        if (idx[i] != -1)
            graph[idx[node]][idx[i]] = dist[i];
}

ll get(int x) {
    return to[x] + dist[x];
}

bool process() {
    memset(dist, INF, sizeof dist);
    dist[f] = 0;

    memset(bio, false, sizeof bio);
    for (int i = 0; i < spec.size(); i++) {
        if (bad[i]) bio[i] = true;
        dad[i] = f;
    }

    for (int i = 1; i < spec.size(); i++) {
        ll mini = INF + 1;
        int x = spec.size();
        for (int j = 0; j < spec.size(); j++)
            if (!bio[j] && dist[j] < mini) {
                mini = dist[j];
                x = j;
            }
        bio[x] = true;
        for (int j = 0; j < spec.size(); j++) {
            ll cand = dist[x] + graph[x][j];
            if (bad[j] || cand >= dist[j]) continue;
            dist[j] = cand;
            dad[j] = x;
        }
    }

    vector <int> path;
    for (int x = s1; x != f; x = dad[x])
        path.push_back(x);
    path.push_back(f);

    int opt = path[0];
    for (int i = 0; i < path.size(); i++)
        if (get(path[i]) < get(opt)) opt = path[i];

    bad[opt] = true;
    ll cand = get(opt) - dist[s1];
    //printf("cand dist graph %I64d %I64d %I64d\n", cand, dist[s1], graph[idx[3]][s1]);
    if (cand > sol) {
        sol = cand;
        memset(in, false, sizeof in);
        for (int i = 1; i < path.size(); i++)
            for (int j = 0; j < K; j++)
                if (u[j] == path[i - 1] && v[j] == path[i] && graph[v[j]][u[j]] == l[j])
                    in[j] = true;
    }

    return opt != s1 && opt != f;
}

int sgn(ll val) {
    if (val > 0) return 0;
    if (val < 0) return 2;
    return 1;
}

void precalc() {
    for (int i = 0; i < spec.size(); i++)
        for (int j = 0; j < spec.size(); j++)
            ngraph[i][j] = graph[j][i];

    for (int i = 0; i < K; i++)
        ngraph[u[i]][v[i]] = min(ngraph[u[i]][v[i]], (ll)r[i]);

    memset(dist, INF, sizeof dist);
    dist[s2] = 0;

    memset(bio, false, sizeof bio);
    for (int i = 1; i < spec.size(); i++) {
        ll mini = INF + 1;
        int x = spec.size();
        for (int j = 0; j < spec.size(); j++)
            if (!bio[j] && dist[j] < mini) {
                mini = dist[j];
                x = j;
            }
        bio[x] = true;
        for (int j = 0; j < spec.size(); j++)
            dist[j] = min(dist[j], dist[x] + ngraph[x][j]);
    }

    memcpy(to, dist, sizeof to);
}

void norm(int &ref) {
    ref = idx[ref];
}

void solve() {
    spec.push_back(s1);
    spec.push_back(s2);
    spec.push_back(f);
    for (int i = 0; i < K; i++) {
        spec.push_back(u[i]);
        spec.push_back(v[i]);
    }

    sort(spec.begin(), spec.end());
    spec.resize(unique(spec.begin(), spec.end()) - spec.begin());
    memset(idx, -1, sizeof idx);
    for (int i = 0; i < spec.size(); i++)
        idx[spec[i]] = i;

    norm(s1);
    norm(s2);
    norm(f);
    for (int i = 0; i < K; i++) {
        norm(u[i]);
        norm(v[i]);
    }

    memset(graph, INF, sizeof graph);
    for (int i = 0; i < spec.size(); i++)
        dijkstra(spec[i]);

    //printf("spec %d\n", spec.size());

    precalc();

    //for (int i = 0; i < 5; i++)
    //    printf("node to %d %I64d\n", spec[i], to[i]);

    for (int i = 0; i < K; i++)
        graph[v[i]][u[i]] = min(graph[v[i]][u[i]], (ll)l[i]);

    while (process());

    int who = sgn(sol);
    puts(msg[who]);
    if (who == 2) return;
    for (int i = 0; i < K; i++)
        printf("%d ", in[i] ? l[i] : r[i]);
    puts("");
}

int main() {
    load();
    solve();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

const int MAXN = 10005;
const int MAXK = 205;
const ll INF = 0x3f3f3f3fll;
const char msg[5][5] = {"WIN", "DRAW", "LOSE"};

int N, M, K;
int s1, s2, f;
int u[MAXK], v[MAXK], l[MAXK], r[MAXK];
vector <pii> E[MAXN];
vector <int> spec;
ll dist[MAXN];
bool bio[MAXN];
ll graph[MAXK][MAXK], ngraph[MAXK][MAXK];
int idx[MAXN];
int dad[MAXK];
bool bad[MAXK];
ll to[MAXK];
bool in[MAXK];
ll sol = -INF;

struct cmp {
    bool operator()(const int &lhs, const int &rhs) const {
        if (dist[lhs] != dist[rhs])
            return dist[lhs] < dist[rhs];
        return lhs < rhs;
    }
};

void load() {
    scanf("%d%d%d", &N, &M, &K);
    scanf("%d%d%d", &s1, &s2, &f);
    while (M--) {
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);
        E[b].push_back(pii(a, c));
    }
    for (int i = 0; i < K; i++)
        scanf("%d%d%d%d", u + i, v + i, l + i, r + i);
}

void dijkstra(int node) {
    memset(dist, INF, sizeof dist);
    memset(bio, false, sizeof bio);
    dist[node] = 0;
    set <int, cmp> S;
    for (int i = 1; i <= N; i++)
        S.insert(i);

    while (!S.empty()) {
        int x = *S.begin();
        S.erase(x);
        bio[x] = true;
        for (int i = 0; i < E[x].size(); i++) {
            int nxt = E[x][i].first;
            if (bio[nxt]) continue;
            ll cand = dist[x] + E[x][i].second;
            if (cand < dist[nxt]) {
                S.erase(nxt);
                dist[nxt] = cand;
                S.insert(nxt);
            }
        }
    }

    for (int i = 1; i <= N; i++)
        if (idx[i] != -1)
            graph[idx[node]][idx[i]] = dist[i];
}

ll get(int x) {
    return to[x] + dist[x];
}

bool process() {
    memset(dist, INF, sizeof dist);
    dist[f] = 0;

    memset(bio, false, sizeof bio);
    for (int i = 0; i < spec.size(); i++) {
        if (bad[i]) bio[i] = true;
        dad[i] = f;
    }

    for (int i = 1; i < spec.size(); i++) {
        ll mini = INF + 1;
        int x = spec.size();
        for (int j = 0; j < spec.size(); j++)
            if (!bio[j] && dist[j] < mini) {
                mini = dist[j];
                x = j;
            }
        bio[x] = true;
        for (int j = 0; j < spec.size(); j++) {
            ll cand = dist[x] + graph[x][j];
            if (bad[j] || cand >= dist[j]) continue;
            dist[j] = cand;
            dad[j] = x;
        }
    }

    vector <int> path;
    for (int x = s1; x != f; x = dad[x])
        path.push_back(x);
    path.push_back(f);

    int opt = path[0];
    for (int i = 0; i < path.size(); i++)
        if (get(path[i]) < get(opt)) opt = path[i];

    bad[opt] = true;
    ll cand = get(opt) - dist[s1];
    if (cand > sol) {
        sol = cand;
        memset(in, false, sizeof in);
        for (int i = 1; i < path.size(); i++)
            for (int j = 0; j < K; j++)
                if (u[j] == path[i - 1] && v[j] == path[i] && graph[v[j]][u[j]] == l[j])
                    in[j] = true;
    }

    return opt != s1 && opt != f;
}

int sgn(ll val) {
    if (val > 0) return 0;
    if (val < 0) return 2;
    return 1;
}

void precalc() {
    for (int i = 0; i < spec.size(); i++)
        for (int j = 0; j < spec.size(); j++)
            ngraph[i][j] = graph[j][i];

    for (int i = 0; i < K; i++)
        ngraph[u[i]][v[i]] = min(ngraph[u[i]][v[i]], (ll)r[i]);

    memset(dist, INF, sizeof dist);
    dist[s2] = 0;

    memset(bio, false, sizeof bio);
    for (int i = 1; i < spec.size(); i++) {
        ll mini = INF + 1;
        int x = spec.size();
        for (int j = 0; j < spec.size(); j++)
            if (!bio[j] && dist[j] < mini) {
                mini = dist[j];
                x = j;
            }
        bio[x] = true;
        for (int j = 0; j < spec.size(); j++)
            dist[j] = min(dist[j], dist[x] + ngraph[x][j]);
    }

    memcpy(to, dist, sizeof to);
}

void norm(int &ref) {
    ref = idx[ref];
}

void solve() {
    spec.push_back(s1);
    spec.push_back(s2);
    spec.push_back(f);
    for (int i = 0; i < K; i++) {
        spec.push_back(u[i]);
        spec.push_back(v[i]);
    }

    sort(spec.begin(), spec.end());
    spec.resize(unique(spec.begin(), spec.end()) - spec.begin());
    memset(idx, -1, sizeof idx);
    for (int i = 0; i < spec.size(); i++)
        idx[spec[i]] = i;

    norm(s1);
    norm(s2);
    norm(f);
    for (int i = 0; i < K; i++) {
        norm(u[i]);
        norm(v[i]);
    }

    memset(graph, INF, sizeof graph);
    for (int i = 0; i < spec.size(); i++)
        dijkstra(spec[i]);

    precalc();

    for (int i = 0; i < K; i++)
        graph[v[i]][u[i]] = min(graph[v[i]][u[i]], (ll)l[i]);

    while (process());

    int who = sgn(sol);
    puts(msg[who]);
    if (who == 2) return;
    for (int i = 0; i < K; i++)
        printf("%d ", in[i] ? l[i] : r[i]);
    puts("");
}

int main() {
    load();
    solve();
    return 0;
}


#include<map>
#include<cmath>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define inf 1e16
#define mod 1000000007
#define ll long long
using namespace std;
ll read()
{
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int s1,s2,T;
int n,m,K,cnt;
struct edge{
    int from,to,next,l,r;
}e[20005];
int last[10005],q[10005];
ll da[10005],db[10005];
bool vis[10005];
void insert(int u,int v,int l,int r)
{
    e[++cnt]=(edge){u,v,last[u],l,r};last[u]=cnt;
}
void spfa(ll *dis,int s)
{
    for(int i=1;i<=n;i++)dis[i]=inf,vis[i]=0;
    int head=0,tail=1;
    q[0]=s;dis[s]=0;vis[s]=1;
    while(head!=tail)
    {
        int x=q[head];head++;vis[x]=0;
        if(head==10000)head=0;
        for(int i=last[x];i;i=e[i].next)
            if(dis[x]+e[i].r<dis[e[i].to])
            {
                dis[e[i].to]=dis[x]+e[i].r;
                if(!vis[e[i].to])
                {
                    q[tail++]=e[i].to;
                    if(tail==10000)tail=0;
                }
                vis[e[i].to]=1;
            }
    }
}
bool solve(int f)
{
    bool flag=1;
    while(flag)
    {
        flag=0;
        spfa(da,s1);spfa(db,s2);
        for(int i=m+1;i<=m+K;i++)
            if(da[e[i].from]<db[e[i].from]+f&&e[i].l!=e[i].r)
            {
                e[i].r=e[i].l;
                flag=1;
            }
        if(da[T]<db[T]+f)
        {
            if(f)puts("DRAW");
            else puts("WIN");
            for(int i=m+1;i<=m+K;i++)
                printf("%d ",e[i].r);
            return 1;
        }
    }
    return 0;
}
int main()
{
    n=read();m=read();K=read();
    s1=read();s2=read();T=read();
    for(int i=1;i<=m;i++)
    {
        int u=read(),v=read(),w=read();
        insert(u,v,w,w);
    }
    for(int i=1;i<=K;i++)
    {
        int u=read(),v=read(),l=read(),r=read();
        insert(u,v,l,r);
    }
    if(!solve(0))
        if(!solve(1))
            puts("LOSE");
    return 0;
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;
struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        d[s1][1] = 0;
        q.insert(mp(0, mp(1, s1)));
        d[s2][0] = 0;
        q.insert(mp(0, mp(0, s2)));

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(!type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }
    if(d[f][1] == d[f][0])
        return 0;
    if(d[f][1] < d[f][0])
        return 1;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
        //g[b].push_back(edge(a, c, c, -1));
    }

    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        g[a].push_back(edge(b, l, r, i));
       // g[b].push_back(edge(a, l, r, i));

    }
    lo ex = deyk(s1, s2, f, n);
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 2010
#define SM 26
using namespace std;
const li INF = 3e9;

vector<pair<lo, li> > g[MN];

void deyk(vector<li> &d, lo fr)
{
    set<pair<li, lo> > q;
    if(fr != -1)
    {
        FOR(i, (lo) d.size())
        {
            d[i] = INF;
        }
        d[fr] = 0;
        q.insert(mp(0, fr));
    }
    else
    {
        FOR(i, (lo) d.size())
        {
            if(d[i] == INF)
                continue;
            q.insert(mp(d[i], i));
        }
    }
    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].first;
            li add = g[id][i].second;
            if(add + val < d[to])
            {
                set<pair<li, lo> >::iterator it = q.find(mp(d[to], to));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to] = add + val;
                q.insert(mp(d[to], to));
            }
        }
    }
}

lo take_val(lo a, lo b, li l, li r, vector<li> &ds1, vector<li> &ds2, vector<li> df, li en1, li en2)
{
    while(r - l > 2)
    {
        li ff = (l * 2 + r) / 3;
        li ss = (l + r * 2) / 3;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        li s = min(en1, min(ds1[a] + ss + df[b], ds1[b] + ss + df[a]))
             - min(en2, min(ds2[a] + ss + df[b], ds2[b] + ss + df[a]));
        if(f < s)
        {
            r = ss;
        }
        else
            l = ff;
    }
    li best = INF;
    lo out  = l;
    for(; l <= r; l++)
    {
        li ff = l;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        if(f < best)
        {
            best = f;
            out = l;
        }
    }
    return out;
}
int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(mp(b, c));
        g[b].push_back(mp(a, c));
    }
    vector<li> ds1(n), ds2(n), df(n);
    deyk(ds1, s1);
    deyk(ds2, s2);
    deyk(df, f);

    li en1 = ds1[f];
    li en2 = ds2[f];
    vector<lo> out(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        lo val = take_val(a, b, l, r, ds1, ds2, df, en1, en2);
        out[i] = val;
        g[a].push_back(mp(b, val));
        g[b].push_back(mp(a, val));
        deyk(ds1, -1);
        deyk(ds2, -1);
        deyk(df, -1);

        en1 = ds1[f];
        en2 = ds2[f];
    }
    if(en1 > en2)
    {
        cout << "LOSE";
        return 0;
    }
    if(en1 == en2)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo long long int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 2010
#define SM 26
using namespace std;
const li INF = 1e15;

vector<pair<lo, li> > g[MN];

void deyk(vector<li> &d, lo fr)
{
    set<pair<li, lo> > q;
    if(fr != -1)
    {
        FOR(i, (lo) d.size())
        {
            d[i] = INF;
        }
        d[fr] = 0;
        q.insert(mp(0, fr));
    }
    else
    {
        FOR(i, (lo) d.size())
        {
            if(d[i] == INF)
                continue;
            q.insert(mp(d[i], i));
        }
    }
    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].first;
            li add = g[id][i].second;
            if(add + val < d[to])
            {
                set<pair<li, lo> >::iterator it = q.find(mp(d[to], to));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to] = add + val;
                q.insert(mp(d[to], to));
            }
        }
    }
}

lo take_val(lo a, lo b, li l, li r, vector<li> &ds1, vector<li> &ds2, vector<li> df, li en1, li en2)
{
    while(r - l > 2)
    {
        li ff = (l * 2 + r) / 3;
        li ss = (l + r * 2) / 3;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        li s = min(en1, min(ds1[a] + ss + df[b], ds1[b] + ss + df[a]))
             - min(en2, min(ds2[a] + ss + df[b], ds2[b] + ss + df[a]));
        if(f < s)
        {
            r = ss;
        }
        else
            l = ff;
    }
    li best = INF;
    lo out  = l;
    for(; l <= r; l++)
    {
        li ff = l;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        if(f < best)
        {
            best = f;
            out = l;
        }
    }
    return out;
}
int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(mp(b, c));
        g[b].push_back(mp(a, c));
    }
    vector<li> ds1(n), ds2(n), df(n);
    deyk(ds1, s1);
    deyk(ds2, s2);
    deyk(df, f);

    li en1 = df[s1];
    li en2 = df[s2];
    vector<lo> out(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        lo val = take_val(a, b, l, r, ds1, ds2, df, en1, en2);
        out[i] = val;
        g[a].push_back(mp(b, val));
        g[b].push_back(mp(a, val));
        deyk(ds1, s1);
        deyk(ds2, s2);
        deyk(df, f);

        en1 = df[s1];
        en2 = df[s2];
    }

    if(en1 > en2)
    {
        cout << "LOSE";
        return 0;
    }
    if(en1 == en2)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;

struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n, bool mode = false)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        if(!mode)
        {
            d[s1][1] = 0;
            q.insert(mp(0, mp(1, s1)));
            d[s2][0] = 0;
            q.insert(mp(0, mp(0, s2)));
        }
        else
        {
            d[f][0] = 0;
            q.insert(mp(0, mp(0, f)));
        }

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(!type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
                g[id][i].type = -1;
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }

    if(d[s1][0] < d[s2][0])
        return 1;
    if(d[s1][0] == d[s2][0])
        return 0;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
    //    g[b].push_back(edge(a, c, c, -1));
    }

    vector<lo> temp(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        temp[i] = l;
        a--;
        b--;
        g[a].push_back(edge(b, l, r, i));
    //    g[b].push_back(edge(a, l, r, i));
    }
    deyk(s1, s2, f, n);
    FOR(i, k)
    {
        if(out[i] == -1)
            out[i] = temp[i];
    }
    lo ex = deyk(s1, s2, f, n, true);
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo long long int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 2010
#define SM 26
using namespace std;
const li INF = 1e15;

vector<pair<lo, li> > g[MN];

void deyk(vector<li> &d, lo fr)
{
    set<pair<li, lo> > q;
    if(fr != -1)
    {
        FOR(i, (lo) d.size())
        {
            d[i] = INF;
        }
        d[fr] = 0;
        q.insert(mp(0, fr));
    }
    else
    {
        FOR(i, (lo) d.size())
        {
            if(d[i] == INF)
                continue;
            q.insert(mp(d[i], i));
        }
    }
    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].first;
            li add = g[id][i].second;
            if(add + val < d[to])
            {
                set<pair<li, lo> >::iterator it = q.find(mp(d[to], to));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to] = add + val;
                q.insert(mp(d[to], to));
            }
        }
    }
}

lo take_val(lo a, lo b, li l, li r, vector<li> &ds1, vector<li> &ds2, vector<li> df, li en1, li en2)
{
    while(r - l > 2)
    {
        li ff = (l * 2 + r) / 3;
        li ss = (l + r * 2) / 3;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        li s = min(en1, min(ds1[a] + ss + df[b], ds1[b] + ss + df[a]))
             - min(en2, min(ds2[a] + ss + df[b], ds2[b] + ss + df[a]));
        if(f < s)
        {
            r = ss;
        }
        else
            l = ff;
    }
    li best = INF;
    lo out  = l;
    for(; l <= r; l++)
    {
        li ff = l;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        if(f < best)
        {
            best = f;
            out = l;
        }
    }
    return out;
}
int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(mp(b, c));
        g[b].push_back(mp(a, c));
    }
    vector<li> ds1(n), ds2(n), df(n);
    deyk(ds1, s1);
    deyk(ds2, s2);
    deyk(df, f);

    li en1 = ds1[f];
    li en2 = ds2[f];
    vector<lo> out(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        lo val = take_val(a, b, l, r, ds1, ds2, df, en1, en2);
        out[i] = val;
        g[a].push_back(mp(b, val));
        g[b].push_back(mp(a, val));
        deyk(ds1, s1);
        deyk(ds2, s2);
        deyk(df, f);

        en1 = ds1[f];
        en2 = ds2[f];
    }
    if(n > 10)
        cout << en1 << " " <<en2 << endl;
    if(en1 > en2)
    {
        cout << "LOSE";
        return 0;
    }
    if(en1 == en2)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;

struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n, bool mode = false)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        if(!mode)
        {
            d[s1][1] = 0;
            q.insert(mp(0, mp(1, s1)));
            d[s2][0] = 0;
            q.insert(mp(0, mp(0, s2)));
        }
        else
        {
            d[f][0] = 0;
            q.insert(mp(0, mp(0, f)));
        }

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(!type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
                g[id][i].type = -1;
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }

    if(d[s1][0] < d[s2][0])
        return 1;
    if(d[s1][0] == d[s2][0])
        return 0;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
        g[b].push_back(edge(a, c, c, -1));
    }

    vector<lo> temp(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        temp[i] = l;
        a--;
        b--;
        g[a].push_back(edge(b, l, r, i));
        g[b].push_back(edge(a, l, r, i));
    }
    deyk(s1, s2, f, n);
    FOR(i, k)
    {
        if(out[i] == -1)
            out[i] = temp[i];
    }
    lo ex = deyk(s1, s2, f, n, true);
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;

struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n, bool mode = false)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        if(!mode)
        {
            d[s1][1] = 0;
            q.insert(mp(0, mp(1, s1)));
            d[s2][0] = 0;
            q.insert(mp(0, mp(0, s2)));
        }
        else
        {
            d[f][0] = 0;
            q.insert(mp(0, mp(0, f)));
        }

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(!type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }

    if(d[s1][0] < d[s2][0])
        return 1;
    if(d[s1][0] == d[s2][0])
        return 0;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
        g[b].push_back(edge(a, c, c, -1));
    }

    vector<lo> temp(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        temp[i] = l;
        a--;
        b--;
        g[a].push_back(edge(b, l, r, i));
        g[b].push_back(edge(a, l, r, i));
    }
    deyk(s1, s2, f, n);
    FOR(i, k)
    {
        if(out[i] == -1)
            out[i] = temp[i];
    }
    lo ex = deyk(s1, s2, f, n, true);
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo long long int
#define li unsigned long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;

struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        d[s1][1] = 0;
        q.insert(mp(0, mp(1, s1)));
        d[s2][0] = 0;
        q.insert(mp(0, mp(0, s2)));

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(!type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }
    if(d[f][1] == d[f][0])
        return 0;
    if(d[f][1] < d[f][0])
        return 1;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
        g[b].push_back(edge(a, c, c, -1));
    }

    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        g[a].push_back(edge(b, l, r, i));
        g[b].push_back(edge(a, l, r, i));

    }
    lo ex = deyk(s1, s2, f, n);
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;

struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        d[s1][1] = 0;
        q.insert(mp(0, mp(1, s1)));
        d[s2][0] = 0;
        q.insert(mp(0, mp(0, s2)));

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(!type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }
    if(d[f][1] == d[f][0])
        return 0;
    if(d[f][1] < d[f][0])
        return 1;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
        g[b].push_back(edge(a, c, c, -1));
    }

    vector<lo> temp(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        temp[i] = l;
        a--;
        b--;
        g[a].push_back(edge(b, l, r, i));
        g[b].push_back(edge(a, l, r, i));
    }
    deyk(s1, s2, f, n);
    FOR(i, k)
    {
        if(out[i] == -1)
            out[i] = temp[i];
    }
    lo ex = deyk(s1, s2, f, n);
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo long long int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 2010
#define SM 26
using namespace std;
const li INF = 1e18;

vector<pair<lo, li> > g[MN];

void deyk(vector<li> &d, lo fr)
{
    set<pair<li, lo> > q;
    if(fr != -1)
    {
        FOR(i, (lo) d.size())
        {
            d[i] = INF;
        }
        d[fr] = 0;
        q.insert(mp(0, fr));
    }
    else
    {
        FOR(i, (lo) d.size())
        {
            if(d[i] == INF)
                continue;
            q.insert(mp(d[i], i));
        }
    }
    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].first;
            li add = g[id][i].second;
            if(add + val < d[to])
            {
                set<pair<li, lo> >::iterator it = q.find(mp(d[to], to));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to] = add + val;
                q.insert(mp(d[to], to));
            }
        }
    }
}

lo take_val(lo a, lo b, li l, li r, vector<li> &ds1, vector<li> &ds2, vector<li> df, li en1, li en2)
{
    while(r - l > 2)
    {
        li ff = (l * 2 + r) / 3;
        li ss = (l + r * 2) / 3;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        li s = min(en1, min(ds1[a] + ss + df[b], ds1[b] + ss + df[a]))
             - min(en2, min(ds2[a] + ss + df[b], ds2[b] + ss + df[a]));
        if(f < s)
        {
            r = ss;
        }
        else
            l = ff;
    }
    li best = INF;
    lo out  = l;
    for(; l <= r; l++)
    {
        li ff = l;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        if(f < best)
        {
            best = f;
            out = l;
        }
    }
    return out;
}
int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(mp(b, c));
        g[b].push_back(mp(a, c));
    }
    vector<li> ds1(n), ds2(n), df(n);
    deyk(ds1, s1);
    deyk(ds2, s2);
    deyk(df, f);

    li en1 = ds1[f];
    li en2 = ds2[f];
    vector<lo> out(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        lo val = take_val(a, b, l, r, ds1, ds2, df, en1, en2);
        out[i] = val;
        g[a].push_back(mp(b, val));
        g[b].push_back(mp(a, val));
        deyk(ds1, s1);
        deyk(ds2, s2);
        deyk(df, f);

        en1 = ds1[f];
        en2 = ds2[f];
    }
    if(en1 > en2)
    {
        cout << "LOSE";
        return 0;
    }
    if(en1 == en2)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;
struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        d[s1][1] = 0;
        q.insert(mp(0, mp(1, s1)));
        d[s2][0] = 0;
        q.insert(mp(0, mp(0, s2)));

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(!type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }
    if(d[f][1] == d[f][0])
        return 0;
    if(d[f][1] < d[f][0])
        return 1;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
        //g[b].push_back(edge(a, c, c, -1));
    }
    vector<lo> temp(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        temp[i] = l;
        g[a].push_back(edge(b, l, r, i));
       // g[b].push_back(edge(a, l, r, i));

    }
    lo ex = deyk(s1, s2, f, n);
    FOR(i, k)
    {
        if(out[i] == -1)
            out[i] = temp[i];
    }
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo long long int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 2010
#define SM 26
using namespace std;
const li INF = 1e18;

vector<pair<lo, li> > g[MN];

void deyk(vector<li> &d, lo fr)
{
    set<pair<li, lo> > q;
    if(fr != -1)
    {
        FOR(i, (lo) d.size())
        {
            d[i] = INF;
        }
        d[fr] = 0;
        q.insert(mp(0, fr));
    }
    else
    {
        FOR(i, (lo) d.size())
        {
            if(d[i] == INF)
                continue;
            q.insert(mp(d[i], i));
        }
    }
    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].first;
            li add = g[id][i].second;
            if(add + val < d[to])
            {
                set<pair<li, lo> >::iterator it = q.find(mp(d[to], to));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to] = add + val;
                q.insert(mp(d[to], to));
            }
        }
    }
}

lo take_val(lo a, lo b, li l, li r, vector<li> &ds1, vector<li> &ds2, vector<li> df, li en1, li en2)
{
    while(r - l > 2)
    {
        li ff = (l * 2 + r) / 3;
        li ss = (l + r * 2) / 3;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        li s = min(en1, min(ds1[a] + ss + df[b], ds1[b] + ss + df[a]))
             - min(en2, min(ds2[a] + ss + df[b], ds2[b] + ss + df[a]));
        if(f < s)
        {
            r = ss;
        }
        else
            l = ff;
    }
    li best = INF;
    lo out  = l;
    for(; l <= r; l++)
    {
        li ff = l;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        if(f < best)
        {
            best = f;
            out = l;
        }
    }
    return out;
}
int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(mp(b, c));
        g[b].push_back(mp(a, c));
    }
    vector<li> ds1(n), ds2(n), df(n);
    deyk(ds1, s1);
    deyk(ds2, s2);
    deyk(df, f);

    li en1 = ds1[f];
    li en2 = ds2[f];
    vector<lo> out(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        lo val = take_val(a, b, l, r, ds1, ds2, df, en1, en2);
        out[i] = val;
        g[a].push_back(mp(b, val));
        g[b].push_back(mp(a, val));
        deyk(ds1, -1);
        deyk(ds2, -1);
        deyk(df, -1);

        en1 = ds1[f];
        en2 = ds2[f];
    }
    if(en1 > en2)
    {
        cout << "LOSE";
        return 0;
    }
    if(en1 == en2)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;

struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        d[s1][1] = 0;
        q.insert(mp(0, mp(1, s1)));
        d[s2][0] = 0;
        q.insert(mp(0, mp(0, s2)));

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(!type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }
    if(n == 44)
    {
        cout << d[f][1] << " " << d[f][0] << endl;
    }
    if(d[f][1] == d[f][0])
        return 0;
    if(d[f][1] < d[f][0])
        return 1;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
        g[b].push_back(edge(a, c, c, -1));
    }

    vector<lo> temp(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        temp[i] = l;
        a--;
        b--;
        g[a].push_back(edge(b, l, r, i));
        g[b].push_back(edge(a, l, r, i));
    }
    deyk(s1, s2, f, n);
    FOR(i, k)
    {
        if(out[i] == -1)
            out[i] = temp[i];
    }
    lo ex = deyk(s1, s2, f, n);
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 200000
#define SM 26
using namespace std;
const li INF = 1e18;

struct edge
{
    lo to, l, r, type;
    edge(lo to , lo l, lo r, lo type) : to(to), l(l), r(r), type(type) {}
};
vector<edge > g[MN];
lo out[MN];
li d[MN][2];
lo deyk(lo s1, lo s2, lo f, lo n)
{
    set<pair<li, pair<lo, lo> > > q;
    set<pair<li, pair<lo, lo> > >::iterator it;
        FOR(i, n) FOR(j, 2)
        {
            d[i][j] = INF;
        }
        d[s1][0] = 0;
        q.insert(mp(0, mp(0, s1)));
        d[s2][1] = 0;
        q.insert(mp(0, mp(1, s2)));

    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second.second;
        lo type = q.begin()->second.first;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].to;
            if(g[id][i].type != -1)
            {
                if(out[g[id][i].type] == -1)
                {
                    if(type)
                        out[g[id][i].type] = g[id][i].r;
                    else
                        out[g[id][i].type] = g[id][i].l;
                }
                g[id][i].l = out[g[id][i].type];
            }
            li add = g[id][i].l;
            if(d[to][type] > val + add)
            {
                it = q.find(mp(d[to][type], mp(type, to)));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to][type] = val + add;
                q.insert(mp(d[to][type], mp(type, to)));
            }
        }
    }

    if(d[f][0] == d[f][1])
        return 0;
    if(d[f][0] < d[f][1])
        return 1;
    return -1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    memset(out, -1, sizeof out);
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(edge(b, c, c, -1));
        g[b].push_back(edge(a, c, c, -1));
    }

    vector<lo> temp(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        temp[i] = l;
        a--;
        b--;
        g[a].push_back(edge(b, l, r, i));
        g[b].push_back(edge(a, l, r, i));
    }
    deyk(s1, s2, f, n);
    FOR(i, k)
    {
        if(out[i] == -1)
            out[i] = temp[i];
    }
    lo ex = deyk(s1, s2, f, n);
    if(ex == -1)
    {
        cout << "LOSE";
        return 0;
    }
    if(!ex)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


#pragma comment(linker, "/STACK:100000000000000")
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h>
#include <cctype>
#include <cassert>
#include <ctime>
#define mp make_pair
#define pb push_back
#define lo long long int
#define li long long int
#define db long double
#define FOR(i, n) for(lo i = 0; i < (n); i++)
#define pi 3.14159265358979323
#define eps 1e-10
#define MN 2010
#define SM 26
using namespace std;
const li INF = 1e15;

vector<pair<lo, li> > g[MN];

void deyk(vector<li> &d, lo fr)
{
    set<pair<li, lo> > q;
    if(fr != -1)
    {
        FOR(i, (lo) d.size())
        {
            d[i] = INF;
        }
        d[fr] = 0;
        q.insert(mp(0, fr));
    }
    else
    {
        FOR(i, (lo) d.size())
        {
            if(d[i] == INF)
                continue;
            q.insert(mp(d[i], i));
        }
    }
    while(!q.empty())
    {
        li val = q.begin()->first;
        lo id = q.begin()->second;
        q.erase(q.begin());
        FOR(i, (lo) g[id].size())
        {
            lo to = g[id][i].first;
            li add = g[id][i].second;
            if(add + val < d[to])
            {
                set<pair<li, lo> >::iterator it = q.find(mp(d[to], to));
                if(it != q.end())
                {
                    q.erase(it);
                }
                d[to] = add + val;
                q.insert(mp(d[to], to));
            }
        }
    }
}

lo take_val(lo a, lo b, li l, li r, vector<li> &ds1, vector<li> &ds2, vector<li> df, li en1, li en2)
{
    while(r - l > 2)
    {
        li ff = (l * 2 + r) / 3;
        li ss = (l + r * 2) / 3;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        li s = min(en1, min(ds1[a] + ss + df[b], ds1[b] + ss + df[a]))
             - min(en2, min(ds2[a] + ss + df[b], ds2[b] + ss + df[a]));
        if(f < s)
        {
            r = ss;
        }
        else
            l = ff;
    }
    li best = INF;
    lo out  = l;
    for(; l <= r; l++)
    {
        li ff = l;
        li f = min(en1, min(ds1[a] + ff + df[b], ds1[b] + ff + df[a]))
             - min(en2, min(ds2[a] + ff + df[b], ds2[b] + ff + df[a]));
        if(f < best)
        {
            best = f;
            out = l;
        }
    }
    return out;
}
int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#else
   // freopen("towers2.in", "r", stdin);
   // freopen("towers2.out", "w", stdout);
#endif
    lo n, m, k;
    cin >> n >> m >> k;
    lo s1, s2, f;
    cin >> s1 >> s2 >> f;
    s1--;
    s2--;
    f--;
    FOR(i, m)
    {
        lo a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back(mp(b, c));
        g[b].push_back(mp(a, c));
    }
    vector<li> ds1(n), ds2(n), df(n);
    deyk(ds1, s1);
    deyk(ds2, s2);
    deyk(df, f);

    li en1 = ds1[f];
    li en2 = ds2[f];
    vector<lo> out(k);
    FOR(i, k)
    {
        lo a, b, l, r;
        cin >> a >> b >> l >> r;
        a--;
        b--;
        lo val = take_val(a, b, l, r, ds1, ds2, df, en1, en2);
        out[i] = val;
        g[a].push_back(mp(b, val));
        g[b].push_back(mp(a, val));
        deyk(ds1, s1);
        deyk(ds2, s2);
        deyk(df, f);

        en1 = ds1[f];
        en2 = ds2[f];
    }
    if(en1 > en2)
    {
        cout << "LOSE";
        return 0;
    }
    if(en1 == en2)
        cout << "DRAW";
    else
        cout << "WIN";
    cout << endl;
    FOR(i, k)
    {
        cout << out[i] << " ";
    }
}


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

#define fru(j,n) for(int j=0; j<(n); ++j)
#define tr(it,v) for(typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define x first
#define y second
#define pb push_back
#define ALL(V) (V).begin(),(V).end()
#if 0
	#define DEB printf
#else
	#define DEB(...)
#endif

typedef long long ll;
typedef double D;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;

const ll inft = 1LL<<60;
const int MAXN = 1000006;//10^6

vector<pii> V[MAXN];
pii E[MAXN];
int n,m,k,ANS[MAXN];
int s[2],f;
ll dist[2][MAXN];
bool play(int add){
	DEB("play %d\n",add);
	fru(h,2)fru(i,n)dist[h][i]=inft;
	fru(h,2)dist[h][s[h]]=0;
	priority_queue<pair<ll,int> > Q;
	fru(h,2)Q.push(make_pair(-dist[h][s[h]],2*s[h]+h));
	while(!Q.empty()){
		pair<ll,int> u=Q.top();Q.pop();
		int g=u.y%2,v=u.y/2;
		if(-u.x!=dist[g][v])continue;
		DEB("mam %lld %d %d\n",-u.x,g,v+1);
		if(v==f)return dist[0][f]<dist[1][f]+add;
		tr(it,V[v]){
			int cost;
			if(dist[0][v]<dist[1][v]+add)cost=E[it->y].x;
			else cost=E[it->y].y;
			DEB("ustalam %d na %d\n",it->y,cost);
			ANS[it->y]=cost;
			if(dist[g][it->x]>cost-u.x){
				dist[g][it->x]=cost-u.x;
				Q.push(make_pair(-dist[g][it->x],2*it->x+g));

			}
		}
	}
}

void solve() {
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d",&s[0],&s[1],&f);
	s[0]--;s[1]--;f--;
	int h=0;
	for(;h<m;h++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);a--;b--;
		E[h].x=E[h].y=c;
		V[a].pb(pii(b,h));
	}
	for(;h<m+k;h++){
		int a,b,c,d;
		scanf("%d%d%d%d",&a,&b,&c,&d);a--;b--;
		E[h].x=c;E[h].y=d;
		ANS[h]=c;
		V[a].pb(pii(b,h));
	}
	if(play(0)){
		puts("WIN");
		fru(i,k)printf("%d ",ANS[m+i]);puts("");
	}
	else if(play(1)){
		puts("DRAW");
		fru(i,k)printf("%d ",ANS[m+i]);puts("");
	}
	else puts("LOSE");
}

int main(){
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int t=1;//scanf("%d",&t);
	fru(i,t) solve();
	return 0;
}


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

int N,M,K,A,B,F,x[maxn],y[maxn],l[maxn],p[maxn],head[maxn],lk[maxn],next[maxn],w[maxn],q[maxn*10],d1[maxn],d2[maxn];
bool b[maxn];

void add(int u,int v,int x,int t) {lk[t]=v,w[t]=x,next[t]=head[u],head[u]=t;}

void init()
{
	int t=0,r;
	scanf("%d%d%d%d%d%d",&N,&M,&K,&A,&B,&F);
	for (int i=1; i<=M; i++) scanf("%d%d%d",&x[i],&y[i],&r),add(x[i],y[i],r,++t);
	for (int i=1; i<=K; i++) scanf("%d%d%d%d",&x[i],&y[i],&l[i],&r),p[i]=++t,add(x[i],y[i],r,t);
}

void spfa(int s,int*d)
{
	memset(d,63,sizeof(d1));
	memset(b,0,sizeof(b));
	q[1]=s,d[s]=0;
	for (int l=1,r=1; l<=r; l++)
	{
		int u=q[l]; b[u]=0;
		for (int i=head[u],v; v=lk[i],i; i=next[i]) if (d[u]+w[i]<d[v])
		{
			d[v]=d[u]+w[i];
			if (!b[v]) b[v]=1,q[++r]=v;
		}
	}
}

bool work(bool f)
{
	for (bool bg=1; bg;)
	{
		bg=0,spfa(A,d1),spfa(B,d2);
		for (int i=1; i<=K; i++) if (!f)
			if (d1[x[i]]<d2[x[i]]&&w[p[i]]!=l[i]) w[p[i]]=l[i],bg=1; else;
		else
			if (d1[x[i]]<=d2[x[i]]&&w[p[i]]!=l[i]) w[p[i]]=l[i],bg=1;
	}
	if (!f)
		if (d1[F]<d2[F]) return puts("WIN"),1; else return 0;
	else
		if (d1[F]<=d2[F]) return puts("DRAW"),1; else return 0;
}

void doit()
{
	if (work(0)||work(1))
		for (int i=1; i<=K; i++) printf("%d%c",w[p[i]],i==K?'\n':' ');
	else puts("LOSE");
}

int main()
{
	init();
	doit();
	return 0;
}


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

int N,M,K,A,B,F,x[maxn],y[maxn],l[maxn],p[maxn],head[maxn],lk[maxn],next[maxn],w[maxn],q[maxn*10],d1[maxn],d2[maxn];
bool b[maxn];

void add(int u,int v,int x,int t) {lk[t]=v,w[t]=x,next[t]=head[u],head[u]=t;}

void init()
{
	int t=0,r;
	scanf("%d%d%d%d%d%d",&N,&M,&K,&A,&B,&F);
	for (int i=1; i<=M; i++) scanf("%d%d%d",&x[i],&y[i],&r),add(x[i],y[i],r,++t);
	for (int i=1; i<=K; i++) scanf("%d%d%d%d",&x[i],&y[i],&l[i],&r),p[i]=++t,add(x[i],y[i],r,t);
}

void spfa(int s,int*d)
{
	memset(d,63,sizeof(d1));
	memset(b,0,sizeof(b));
	q[1]=s,d[s]=0;
	for (int l=1,r=1; l<=r; l++)
	{
		int u=q[l]; b[u]=0;
		for (int i=head[u],v; v=lk[i],i; i=next[i]) if (d[u]+w[i]<d[v])
		{
			d[v]=d[u]+w[i];
			if (!b[v]) b[v]=1,q[++r]=v;
		}
	}
}

bool work(bool f)
{
	for (bool bg=1; bg;)
	{
		bg=0,spfa(A,d1),spfa(B,d2);
		for (int i=1; i<=K; i++) if (!f)
			if (d1[x[i]]<d2[x[i]]&&w[p[i]]!=l[i]) w[p[i]]=l[i],bg=1; else;
		else
			if (d1[x[i]]<=d2[x[i]]&&w[p[i]]!=l[i]) w[p[i]]=l[i],bg=1;
	}
	if (!f)
		if (d1[F]<d2[F]) return puts("WIN"),1; else return 0;
	else
		if (d1[F]<=d2[F]) return puts("DRAW"),1; else return 0;
}

void doit()
{
	if (work(0)||work(1))
	{
		if (N==1e4) cout<<d1[F]<<' '<<d2[F]<<endl;
		for (int i=1; i<=K; i++) printf("%d%c",w[p[i]],i==K?'\n':' ');
	}
	else puts("LOSE");
}

int main()
{
	init();
	doit();
	return 0;
}


#include <bits/stdc++.h>
#define maxn 200005
#define ll long long
using namespace std;

int N,M,K,A,B,F,x[maxn],y[maxn],l[maxn],p[maxn],head[maxn],lk[maxn],next[maxn],w[maxn],q[maxn];
ll d1[maxn],d2[maxn];
bool b[maxn];

void add(int u,int v,int x,int t) {lk[t]=v,w[t]=x,next[t]=head[u],head[u]=t;}

void init()
{
	int t=0,r;
	scanf("%d%d%d%d%d%d",&N,&M,&K,&A,&B,&F);
	for (int i=1; i<=M; i++) scanf("%d%d%d",&x[i],&y[i],&r),add(x[i],y[i],r,++t);
	for (int i=1; i<=K; i++) scanf("%d%d%d%d",&x[i],&y[i],&l[i],&r),p[i]=++t,add(x[i],y[i],r,t);
}

void spfa(int s,ll*d)
{
	memset(d,63,sizeof(d1));
	memset(b,0,sizeof(b));
	q[1]=s,d[s]=0;
	for (int l=1,r=1; l<=r; l++)
	{
		int u=q[l]; b[u]=0;
		for (int i=head[u],v; v=lk[i],i; i=next[i]) if (d[u]+w[i]<d[v])
		{
			d[v]=d[u]+w[i];
			if (!b[v]) b[v]=1,q[++r]=v;
		}
	}
}

bool work(bool f)
{
	for (bool bg=1; bg;)
	{
		bg=0,spfa(A,d1),spfa(B,d2);
		for (int i=1; i<=K; i++) if (!f)
			if (d1[x[i]]<d2[x[i]]&&w[p[i]]!=l[i]) w[p[i]]=l[i],bg=1; else;
		else
			if (d1[x[i]]<=d2[x[i]]&&w[p[i]]!=l[i]) w[p[i]]=l[i],bg=1;
	}
	if (!f)
		if (d1[F]<d2[F]) return puts("WIN"),1; else return 0;
	else
		if (d1[F]<=d2[F]) return puts("DRAW"),1; else return 0;
}

void doit()
{
	if (work(0)||work(1))
		for (int i=1; i<=K; i++) printf("%d%c",w[p[i]],i==K?'\n':' ');
	else puts("LOSE");
}

int main()
{
	init();
	doit();
	return 0;
}


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

int N,M,K,A,B,F,x[maxn],y[maxn],l[maxn],p[maxn],head[maxn],lk[maxn],next[maxn],w[maxn],q[maxn],d1[maxn],d2[maxn];
bool b[maxn];

void add(int u,int v,int x,int t) {lk[t]=v,w[t]=x,next[t]=head[u],head[u]=t;}

void init()
{
	int t=0,r;
	scanf("%d%d%d%d%d%d",&N,&M,&K,&A,&B,&F);
	for (int i=1; i<=M; i++) scanf("%d%d%d",&x[i],&y[i],&r),add(x[i],y[i],r,++t);
	for (int i=1; i<=K; i++) scanf("%d%d%d%d",&x[i],&y[i],&l[i],&r),p[i]=++t,add(x[i],y[i],r,t);
}

void spfa(int s,int*d)
{
	memset(d,63,sizeof(d1));
	memset(b,0,sizeof(b));
	q[1]=s,d[s]=0;
	for (int l=1,r=1; l<=r; l++)
	{
		int u=q[l]; b[u]=0;
		for (int i=head[u],v; v=lk[i],i; i=next[i]) if (d[u]+w[i]<d[v])
		{
			d[v]=d[u]+w[i];
			if (!b[v]) b[v]=1,q[++r]=v;
		}
	}
}

bool work(bool f)
{
	for (bool bg=1; bg;)
	{
		bg=0,spfa(A,d1),spfa(B,d2);
		for (int i=1; i<=K; i++) if (!f)
			if (d1[x[i]]<d2[x[i]]&&w[p[i]]!=l[i]) w[p[i]]=l[i],bg=1; else;
		else
			if (d1[x[i]]<=d2[x[i]]&&w[p[i]]!=l[i]) w[p[i]]=l[i],bg=1;
	}
	if (!f)
		if (d1[F]<d2[F]) return puts("WIN"),1; else return 0;
	else
		if (d1[F]<=d2[F]) return puts("DRAW"),1; else return 0;
}

void doit()
{
	if (work(0)||work(1))
		for (int i=1; i<=K; i++) printf("%d%c",w[p[i]],i==K?'\n':' ');
	else puts("LOSE");
}

int main()
{
	init();
	doit();
	return 0;
}


#include <cstdio>
#include <vector>
#include <queue>
#include <memory.h>
using namespace std;
typedef pair<int, pair<int,int> > piii;
int n,m,i,j,k,x,y,z,zz,e,p[2][10100],ans[10100];
vector<piii> g[10100];
vector<int> ed[10100];
bool u[2][10100];
priority_queue<piii, vector<piii>, greater<piii> > q;
int main() {
  scanf("%d%d%d%d%d%d",&n,&m,&k,&x,&y,&e);
  memset(p,255,sizeof(p));
  p[0][x]=p[0][y]=0;
  q.push(make_pair(0,make_pair(0,x)));
  q.push(make_pair(0,make_pair(1,y)));
  for (i=0; i<m; i++) {
    scanf("%d%d%d",&x,&y,&z);
    g[x].push_back(make_pair(y,make_pair(z,z)));
    ed[x].push_back(k);
  }
  for (i=0; i<k; i++) {
    scanf("%d%d%d%d",&x,&y,&z,&zz);
    g[x].push_back(make_pair(y,make_pair(z,zz)));
    ed[x].push_back(i);
  }
  while (!q.empty()) {
    z=q.top().first;
    x=q.top().second.first;
    y=q.top().second.second;
    q.pop();
    if (u[x][y]) continue;
    u[x][y]=true;
    for (j=0; j<g[y].size(); j++) {
      i=g[y][j].first;
      if (u[1-x][y]) {
        if (x) zz=g[y][j].second.first; else zz=g[y][j].second.second;
      } else {
        if (x) zz=g[y][j].second.second; else zz=g[y][j].second.first;
        ans[ed[y][j]]=zz;
      }
      if (p[x][i]==-1 || z+zz<p[x][i]) {
        p[x][i]=z+zz;
        q.push(make_pair(z+zz,make_pair(x,i)));
      }
    }
  }
  if (p[0][e]<=p[1][e]) {
    puts(p[0][e]<p[1][e]?"WIN":"DRAW");
    for (i=0; i<k; i++) printf("%d%c",ans[i],(i==k-1)?'\n':' ');
  } else puts("LOSE");
  return 0;
}


#include <cstdio>
#include <vector>
#include <queue>
#include <memory.h>
using namespace std;
typedef pair<int, pair<int,int> > piii;
typedef pair<long long, pair<int,int> > pllii;
int n,m,i,j,k,x,y,z,zz,e,ans[10100];
long long p[2][10100];
vector<piii> g[10100];
vector<int> ed[10100];
bool u[2][10100];
priority_queue<pllii, vector<pllii>, greater<pllii> > q;
int main() {
  scanf("%d%d%d%d%d%d",&n,&m,&k,&x,&y,&e);
  memset(p,255,sizeof(p));
  p[0][x]=p[0][y]=0;
  q.push(make_pair(0,make_pair(0,x)));
  q.push(make_pair(0,make_pair(1,y)));
  for (i=0; i<m; i++) {
    scanf("%d%d%d",&x,&y,&z);
    g[x].push_back(make_pair(y,make_pair(z,z)));
    ed[x].push_back(k);
  }
  for (i=0; i<k; i++) {
    scanf("%d%d%d%d",&x,&y,&z,&zz);
    g[x].push_back(make_pair(y,make_pair(z,zz)));
    ed[x].push_back(i);
    ans[i]=z;
  }
  while (!q.empty()) {
    long long z=q.top().first;
    x=q.top().second.first;
    y=q.top().second.second;
    q.pop();
    if (u[x][y]) continue;
    u[x][y]=true;
    for (j=0; j<g[y].size(); j++) {
      i=g[y][j].first;
      if (u[1-x][y]) {
        if (x) zz=g[y][j].second.first; else zz=g[y][j].second.second;
      } else {
        if (x) zz=g[y][j].second.second; else zz=g[y][j].second.first;
        ans[ed[y][j]]=zz;
      }
      if (p[x][i]==-1 || z+zz<p[x][i]) {
        p[x][i]=z+zz;
        q.push(make_pair(z+zz,make_pair(x,i)));
      }
    }
  }
  for (i=0; i<2; i++) for (j=0; j<=n; j++) if (p[i][j]==-1) p[i][j]=1000000000000000000LL;
  if (p[0][e]<=p[1][e]) {
    puts(p[0][e]<p[1][e]?"WIN":"DRAW");
    for (i=0; i<k; i++) printf("%d%c",ans[i],(i==k-1)?'\n':' ');
  } else puts("LOSE");
  return 0;
}


#include <cstdio>
#include <vector>
#include <queue>
#include <memory.h>
using namespace std;
typedef pair<int, pair<int,int> > piii;
int n,m,i,j,k,x,y,z,zz,e,p[2][10100],ans[10100];
vector<piii> g[10100];
vector<int> ed[10100];
bool u[2][10100];
priority_queue<piii, vector<piii>, greater<piii> > q;
int main() {
  scanf("%d%d%d%d%d%d",&n,&m,&k,&x,&y,&e);
  memset(p,255,sizeof(p));
  p[0][x]=p[0][y]=0;
  q.push(make_pair(0,make_pair(0,x)));
  q.push(make_pair(0,make_pair(1,y)));
  for (i=0; i<m; i++) {
    scanf("%d%d%d",&x,&y,&z);
    g[x].push_back(make_pair(y,make_pair(z,z)));
    ed[x].push_back(k);
  }
  for (i=0; i<k; i++) {
    scanf("%d%d%d%d",&x,&y,&z,&zz);
    g[x].push_back(make_pair(y,make_pair(z,zz)));
    ed[x].push_back(i);
    ans[i]=z;
  }
  while (!q.empty()) {
    z=q.top().first;
    x=q.top().second.first;
    y=q.top().second.second;
    q.pop();
    if (u[x][y]) continue;
    u[x][y]=true;
    for (j=0; j<g[y].size(); j++) {
      i=g[y][j].first;
      if (u[1-x][y]) {
        if (x) zz=g[y][j].second.first; else zz=g[y][j].second.second;
      } else {
        if (x) zz=g[y][j].second.second; else zz=g[y][j].second.first;
        ans[ed[y][j]]=zz;
      }
      if (p[x][i]==-1 || z+zz<p[x][i]) {
        p[x][i]=z+zz;
        q.push(make_pair(z+zz,make_pair(x,i)));
      }
    }
  }
  if (p[0][e]<=p[1][e]) {
    puts(p[0][e]<p[1][e]?"WIN":"DRAW");
    for (i=0; i<k; i++) printf("%d%c",ans[i],(i==k-1)?'\n':' ');
  } else puts("LOSE");
  return 0;
}


#include <string.h>
#include <queue>
#include <algorithm>
#include <functional>
#include <utility>
#include <iostream>
#include <vector>
using namespace std;

#define NMAX 10010
#define MMAX 11000

typedef unsigned long long LL;

int N, M, K, S1, S2, T;
struct Edge {
  int u, v, len;
  Edge* next;
};
Edge es[MMAX];
int en;
Edge* head[NMAX];

LL d1[NMAX], d2[NMAX];
int small[110], big[110];

void Add(int u, int v, int len) {
  Edge* p = &es[en++];
  p->u = u;
  p->v = v;
  p->len = len;
  p->next = head[u];
  head[u] = p;
}

void Dijkstr(int s, int t, LL *dis) {
  memset(dis, 0xff, NMAX * sizeof(LL));
  priority_queue< pair<LL, int>, vector< pair<LL, int> >, greater< pair<LL, int> > > pri_queue;
  dis[s] = 0;
  pri_queue.push(make_pair(0LL, s));

  while (!pri_queue.empty()) {
    LL len = pri_queue.top().first;
    int u = pri_queue.top().second;
    pri_queue.pop();
    if (len > dis[u]) {
      continue;
    }
    for (Edge* p = head[u]; p != NULL; p = p->next) {
      int v = p->v;
      if (dis[v] > dis[u] + p->len) {
        dis[v] = dis[u] + p->len;
        pri_queue.push(make_pair(dis[v], v));
      }
    }
  }
}

int main() {
  cin.sync_with_stdio(false);

  en = 0;
  memset(head, 0, sizeof(head));

  int i, j;
  cin >> N >> M >> K >> S1 >> S2 >> T;
  for (i = 0; i < M; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    Add(a, b, c);
  }
  for (i = 0; i < K; ++i) {
    int a, b, l, r;
    cin >> a >> b >> l >> r;
    small[i] = l;
    big[i] = r;
    Add(a, b, r);
  }

  bool flag = true;
  while (flag) {
    flag = false;
    Dijkstr(S1, T, d1);
    Dijkstr(S2, T, d2);

    if (d1[T] < d2[T]) break;
    for (i = 0; i < K; ++i) {
      Edge* p = &es[M+i];
      int u = p->u;
      if (d1[u] < d2[u] && p->len != small[i]) {
        flag = true;
        p->len = small[i];
      }
    }
  }

  if (d1[T] < d2[T] || d1[T] == d2[T]) {
    if (d1[T] < d2[T]) cout << "WIN" << endl;
    else cout << "DRAW" << endl;
    for (i = 0; i < K; ++i) {
      cout << es[M+i].len;
      if (i == K-1) cout << endl;
      else cout << " ";
    }
  } else {
    cout << "LOSE" << endl;
  }

  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>

using namespace std;

#define prt(x) cout<<#x<<":"<<x<<" "
#define prtn(x) cout<<#x<<":"<<x<<endl
#define shut assert(0)
#define when printf("%.2f\n",1.0*clock()/CLOCKS_PER_SEC)
#define rep(i,s,t) for(int i=s,i##_=(t)-1;i<=i##_;++i)
#define per(i,s,t) for(int i=(t)-1,i##_=s;i>=i##_;--i)
#define inf (1<<30)
#define INF (1LL<<62)
#define pb push_back
#define NOO puts("-1"),0
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) (int)(x).size()

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
struct ii
{
	int x,y;
	ii(int x=0,int y=0):x(x),y(y){}
	bool operator<(const ii &a)const{if(x!=a.x)return x<a.x;return y<a.y;}
	bool operator==(const ii&a)const{return x==a.x&&y==a.y;}
	ii friend operator+(ii a,ii b){return ii(a.x+b.x,a.y+b.y);}
	ii friend operator-(ii a,ii b){return ii(a.x-b.x,a.y-b.y);}
};
typedef vector<int> VI;
typedef vector<VI> MT;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<long long>VLL;
typedef vector<ii> VII;

template<class T>void sc(T &x)
{
	x=0;char c;int f=1;
	while(c=getchar(),c<48)if(c=='-')f=-1;
	do x=x*10+(c^48);
	while(c=getchar(),c>47);
	x*=f;
}
template<class T>void nt(T x)
{
	if(!x)return;
	nt(x/10);putchar(x%10+'0');
}
template<class T>void pt(T x)
{
	if(x<0)putchar('-'),x=-x;
	if(!x)putchar('0');else nt(x);
}
template<class T>void pts(T x)
{
	pt(x);putchar(' ');
}
template<class T>void ptn(T x)
{
	pt(x);putchar('\n');
}
template<class v>void pp(v x,int y)
{
	static char ch[]={" \n"};
	pt(x);putchar(ch[y]);
}
template<class T>void PP(T *x,int y)
{
	rep(i,0,y)pp(x[i],i==y-1);
}
template<class T>void Max(T &x,T y){if(x<y)x=y;}
template<class T>void Min(T &x,T y){if(x>y)x=y;}
/*
	template ends here
*/
const int maxm=10105;
const int maxn=10005;
int n,m,K;
int sa,sb,ed;
int point[maxm],nextp[maxm],head[maxn],ecnt;
int lx[maxm],rx[maxm],vx[maxm];
ll A[maxn],B[maxn];
void ins(int u,int v,int x,int y)
{
	point[++ecnt]=v;
	nextp[ecnt]=head[u];
	head[u]=ecnt;
	lx[ecnt]=x;
	rx[ecnt]=y;
}
struct node
{
	ll dis;int pos,nam;
	bool operator < (const node&a)const
	{
		if(dis==a.dis)return nam>a.nam;
		return dis>a.dis;
	}
};
bool DJ(int F)
{
	memset(A,0x7f,sizeof A);
	memset(B,0x7f,sizeof B);
	memset(vx,0,sizeof vx);

	priority_queue<node>Q;
	Q.push((node){F,sa,0});
	A[sa]=F;

	Q.push((node){0,sb,1});
	B[sb]=0;

	while(!Q.empty())
	{
		node p=Q.top();Q.pop();

		ll dis=p.dis;
		int pos=p.pos;

		if(pos==ed)return p.nam==0;

		if(p.nam==0)
		{
			if(A[pos]<dis)continue;
			for(int i=head[pos];i;i=nextp[i])
			{
				int to=point[i];
				if(!vx[i])vx[i]=lx[i];
				if(A[to]>A[pos]+vx[i])
				{
					A[to]=A[pos]+vx[i];
					Q.push((node){A[to],to,0});
				}
			}
		}
		else
		{
			if(B[pos]<dis)continue;
			for(int i=head[pos];i;i=nextp[i])
			{
				int to=point[i];
				if(!vx[i])vx[i]=rx[i];
				if(B[to]>B[pos]+vx[i])
				{
					B[to]=B[pos]+vx[i];
					Q.push((node){B[to],to,1});
				}
			}
		}
	}
	return 0;
}
int main()
{
//	freopen("pro.in","r",stdin);
//	freopen("chk.out","w",stdout);
	sc(n);sc(m);sc(K);
	sc(sa);sc(sb);sc(ed);
	rep(i,0,m)
	{
		int u,v,w;
		sc(u);sc(v);sc(w);
		ins(u,v,w,w);
	}
	rep(i,0,K)
	{
		int u,v,x,y;
		sc(u);sc(v);sc(x);sc(y);
		ins(u,v,x,y);
	}
	if(DJ(1))
	{
		puts("WIN");
		rep(i,m+1,m+K+1)
		pp(vx[i],i==i_);
		return 0;
	}
	if(DJ(0))
	{
		puts("DRAW");
		rep(i,m+1,m+K+1)
		pp(vx[i],i==i_);
		return 0;
	}
	puts("LOSE");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>

using namespace std;

#define prt(x) cout<<#x<<":"<<x<<" "
#define prtn(x) cout<<#x<<":"<<x<<endl
#define shut assert(0)
#define when printf("%.2f\n",1.0*clock()/CLOCKS_PER_SEC)
#define rep(i,s,t) for(int i=s,i##_=(t)-1;i<=i##_;++i)
#define per(i,s,t) for(int i=(t)-1,i##_=s;i>=i##_;--i)
#define inf (1<<30)
#define INF (1LL<<62)
#define pb push_back
#define NOO puts("-1"),0
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) (int)(x).size()

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
struct ii
{
	int x,y;
	ii(int x=0,int y=0):x(x),y(y){}
	bool operator<(const ii &a)const{if(x!=a.x)return x<a.x;return y<a.y;}
	bool operator==(const ii&a)const{return x==a.x&&y==a.y;}
	ii friend operator+(ii a,ii b){return ii(a.x+b.x,a.y+b.y);}
	ii friend operator-(ii a,ii b){return ii(a.x-b.x,a.y-b.y);}
};
typedef vector<int> VI;
typedef vector<VI> MT;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<long long>VLL;
typedef vector<ii> VII;

template<class T>void sc(T &x)
{
	x=0;char c;int f=1;
	while(c=getchar(),c<48)if(c=='-')f=-1;
	do x=x*10+(c^48);
	while(c=getchar(),c>47);
	x*=f;
}
template<class T>void nt(T x)
{
	if(!x)return;
	nt(x/10);putchar(x%10+'0');
}
template<class T>void pt(T x)
{
	if(x<0)putchar('-'),x=-x;
	if(!x)putchar('0');else nt(x);
}
template<class T>void pts(T x)
{
	pt(x);putchar(' ');
}
template<class T>void ptn(T x)
{
	pt(x);putchar('\n');
}
template<class v>void pp(v x,int y)
{
	static char ch[]={" \n"};
	pt(x);putchar(ch[y]);
}
template<class T>void PP(T *x,int y)
{
	rep(i,0,y)pp(x[i],i==y-1);
}
template<class T>void Max(T &x,T y){if(x<y)x=y;}
template<class T>void Min(T &x,T y){if(x>y)x=y;}
/*
	template ends here
*/
const int maxm=10105;
const int maxn=10005;
int n,m,K;
int sa,sb,ed;
int point[maxm],nextp[maxm],head[maxn],ecnt;
int lx[maxm],rx[maxm],vx[maxm];
ll A[maxn],B[maxn];
void ins(int u,int v,int x,int y)
{
	point[++ecnt]=v;
	nextp[ecnt]=head[u];
	head[u]=ecnt;
	lx[ecnt]=x;
	rx[ecnt]=y;
}
struct node
{
	ll dis;int pos,nam;
	bool operator < (const node&a)const
	{
		if(dis==a.dis)return nam>a.nam;
		return dis>a.dis;
	}
};
bool DJ(int F)
{
	memset(A,0x7f,sizeof A);
	memset(B,0x7f,sizeof B);
	memset(vx,0,sizeof vx);

	priority_queue<node>Q;
	Q.push((node){F,sa,0});
	A[sa]=F;

	Q.push((node){0,sb,1});
	B[sb]=0;

	while(!Q.empty())
	{
		node p=Q.top();Q.pop();

		ll dis=p.dis;
		int pos=p.pos;

		if(pos==ed)return p.nam==0;

		if(p.nam==0)
		{
			if(A[pos]<dis)continue;
			for(int i=head[pos];i;i=nextp[i])
			{
				int to=point[i];
				if(!vx[i])vx[i]=lx[i];
				if(A[to]>A[pos]+vx[i])
				{
					A[to]=A[pos]+vx[i];
					Q.push((node){A[to],to,0});
				}
			}
		}
		else
		{
			if(B[pos]<dis)continue;
			for(int i=head[pos];i;i=nextp[i])
			{
				int to=point[i];
				if(!vx[i])vx[i]=rx[i];
				if(B[to]>B[pos]+vx[i])
				{
					B[to]=B[pos]+vx[i];
					Q.push((node){B[to],to,1});
				}
			}
		}
	}
	return 0;
}
int main()
{
//	freopen("pro.in","r",stdin);
//	freopen("chk.out","w",stdout);
	sc(n);sc(m);sc(K);
	sc(sa);sc(sb);sc(ed);
	rep(i,0,m)
	{
		int u,v,w;
		sc(u);sc(v);sc(w);
		ins(u,v,w,w);
	}
	rep(i,0,K)
	{
		int u,v,x,y;
		sc(u);sc(v);sc(x);sc(y);
		ins(u,v,x,y);
	}
	if(DJ(1))
	{
		puts("WIN");
		rep(i,m+1,m+K+1)
		pp(max(vx[i],lx[i]),i==i_);
		return 0;
	}
	if(DJ(0))
	{
		puts("DRAW");
		rep(i,m+1,m+K+1)
		pp(max(vx[i],lx[i]),i==i_);
		return 0;
	}
	puts("LOSE");
	return 0;
}


#include<cstdio>
#include<iostream>
#include<queue>
#define FR first
#define SC second
#define MP make_pair
using namespace std;
struct rec  {int x,y,l,r;};
struct Edge {int y,z,ne;};
typedef long long LL;
typedef pair<LL,int> PII;
const int N=10010;
const LL inf=10000000000010LL;
int n,m,k,num;
int s1,s2,aim;
LL f1[N],f2[N];
int v[N];
rec tmp[N];
priority_queue<PII> Q;
rec q[N];
Edge e[100000];int last[N];
inline void add(int x,int y,int z)
{
	e[++num]=(Edge){y,z,last[x]};last[x]=num;
}
inline void dij(int S,LL *f)
{
	for (int i=1;i<=n;i++) f[i]=inf;
	f[S]=0;
	while (!Q.empty()) Q.pop();
	Q.push(MP(0,S));
	while (!Q.empty())
	{
		PII tmp=Q.top();Q.pop();
		int now=tmp.SC;
		LL dis=tmp.FR;
		if (f[now]!=dis) continue;
		for (int j=last[now];j;j=e[j].ne)
		if (f[e[j].y]>dis+e[j].z)
		{
			f[e[j].y]=dis+e[j].z;
			Q.push(MP(f[e[j].y],e[j].y));
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d",&s1,&s2,&aim);
	for (int i=1;i<=m;i++)
	{
		scanf("%d%d%d",&tmp[i].x,&tmp[i].y,&tmp[i].r);
		add(tmp[i].x,tmp[i].y,tmp[i].r);
	}
	for (int i=1;i<=k;i++)
	{
		scanf("%d%d%d%d",&q[i].x,&q[i].y,&q[i].l,&q[i].r);
		add(q[i].x,q[i].y,q[i].r);
	}
	while (1)
	{
		dij(s1,f1);dij(s2,f2);
		int flag=0;
		for (int i=1;i<=k;i++)
		if (!v[i]&&f1[q[i].x]<f2[q[i].y])
		{
			add(q[i].x,q[i].y,q[i].l);
			flag=1;
			v[i]=1;
		}
		if (!flag) break;
	}
	if (f1[aim]<f2[aim])
	{
		printf("WIN\n");
		for (int i=1;i<=k;i++) printf("%d ",v[i]?q[i].l:q[i].r);
		return 0;
	}

	for (int i=1;i<=n;i++) v[i]=last[i]=0;
	num=0;
	for (int i=1;i<=m;i++) add(tmp[i].x,tmp[i].y,tmp[i].r);
	for (int i=1;i<=k;i++) add(q[i].x,q[i].y,q[i].r);

	while (1)
	{
		dij(s1,f1);dij(s2,f2);
		int flag=0;
		for (int i=1;i<=k;i++)
		if (!v[i]&&f1[q[i].x]<=f2[q[i].y])
		{
			add(q[i].x,q[i].y,q[i].l);
			flag=1;
			v[i]=1;
		}
		if (!flag) break;
	}
	if (f1[aim]<=f2[aim])
	{
		printf("DRAW\n");
		for (int i=1;i<=k;i++) printf("%d ",v[i]?q[i].l:q[i].r);
		return 0;
	}
	printf("LOSE\n");
	return 0;
}


#include<cstdio>
#include<iostream>
#include<queue>
#define FR first
#define SC second
#define MP make_pair
using namespace std;
struct rec  {int x,y,l,r;};
struct Edge {int y,z,ne;};
typedef pair<int,int> PII;
typedef long long LL;
const int N=10010;
const LL inf=10000000000010LL;
int n,m,k,num;
int s1,s2,aim;
LL f1[N],f2[N];
int v[N];
rec tmp[N];
priority_queue<PII> Q;
rec q[N];
Edge e[100000];int last[N];
inline void add(int x,int y,int z)
{
	e[++num]=(Edge){y,z,last[x]};last[x]=num;
}
inline void dij(int S,LL *f)
{
	for (int i=1;i<=n;i++) f[i]=inf;
	f[S]=0;
	while (!Q.empty()) Q.pop();
	Q.push(MP(0,S));
	while (!Q.empty())
	{
		PII tmp=Q.top();Q.pop();
		int now=tmp.SC,dis=tmp.FR;
		if (f[now]!=dis) continue;
		for (int j=last[now];j;j=e[j].ne)
		if (f[e[j].y]>dis+e[j].z)
		{
			f[e[j].y]=dis+e[j].z;
			Q.push(MP(f[e[j].y],e[j].y));
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d",&s1,&s2,&aim);
	for (int i=1;i<=m;i++)
	{
		scanf("%d%d%d",&tmp[i].x,&tmp[i].y,&tmp[i].r);
		add(tmp[i].x,tmp[i].y,tmp[i].r);
	}
	for (int i=1;i<=k;i++)
	{
		scanf("%d%d%d%d",&q[i].x,&q[i].y,&q[i].l,&q[i].r);
		add(q[i].x,q[i].y,q[i].r);
	}
	while (1)
	{
		dij(s1,f1);dij(s2,f2);
		int flag=0;
		for (int i=1;i<=k;i++)
		if (!v[i]&&f1[q[i].x]<f2[q[i].y])
		{
			add(q[i].x,q[i].y,q[i].l);
			flag=1;
			v[i]=1;
		}
		if (!flag) break;
	}
	if (f1[aim]<f2[aim])
	{
		printf("WIN\n");
		for (int i=1;i<=k;i++) printf("%d ",v[i]?q[i].l:q[i].r);
		return 0;
	}

	for (int i=1;i<=n;i++) v[i]=last[i]=0;
	num=0;
	for (int i=1;i<=m;i++) add(tmp[i].x,tmp[i].y,tmp[i].r);
	for (int i=1;i<=k;i++) add(q[i].x,q[i].y,q[i].r);

	while (1)
	{
		dij(s1,f1);dij(s2,f2);
		int flag=0;
		for (int i=1;i<=k;i++)
		if (!v[i]&&f1[q[i].x]<=f2[q[i].y])
		{
			add(q[i].x,q[i].y,q[i].l);
			flag=1;
			v[i]=1;
		}
		if (!flag) break;
	}
	if (f1[aim]<=f2[aim])
	{
		printf("DRAW\n");
		for (int i=1;i<=k;i++) printf("%d ",v[i]?q[i].l:q[i].r);
		return 0;
	}
	printf("LOSE\n");
	return 0;
}


#include<cstdio>
#include<iostream>
#include<queue>
#define FR first
#define SC second
#define MP make_pair
using namespace std;
struct rec  {int x,y,l,r;};
struct Edge {int y,z,ne;};
typedef long long LL;
typedef pair<LL,int> PII;
const int N=10010;
const LL inf=10000000000010LL;
int n,m,k,num;
int s1,s2,aim;
LL f1[N],f2[N];
int v[N];
rec tmp[N];
priority_queue<PII> Q;
rec q[N];
Edge e[100000];int last[N];
inline void add(int x,int y,int z)
{
	e[++num]=(Edge){y,z,last[x]};last[x]=num;
}
inline void dij(int S,LL *f)
{
	for (int i=1;i<=n;i++) f[i]=inf;
	f[S]=0;
	while (!Q.empty()) Q.pop();
	Q.push(MP(0,S));
	while (!Q.empty())
	{
		PII tmp=Q.top();Q.pop();
		int now=tmp.SC;
		LL dis=tmp.FR;
		if (f[now]!=dis) continue;
		for (int j=last[now];j;j=e[j].ne)
		if (f[e[j].y]>dis+e[j].z)
		{
			f[e[j].y]=dis+e[j].z;
			Q.push(MP(f[e[j].y],e[j].y));
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d",&s1,&s2,&aim);
	for (int i=1;i<=m;i++)
	{
		scanf("%d%d%d",&tmp[i].x,&tmp[i].y,&tmp[i].r);
		add(tmp[i].x,tmp[i].y,tmp[i].r);
	}
	for (int i=1;i<=k;i++)
	{
		scanf("%d%d%d%d",&q[i].x,&q[i].y,&q[i].l,&q[i].r);
		add(q[i].x,q[i].y,q[i].r);
	}
	while (1)
	{
		dij(s1,f1);dij(s2,f2);
		int flag=0;
		for (int i=1;i<=k;i++)
		if (!v[i]&&f1[q[i].x]<f2[q[i].x])
		{
			add(q[i].x,q[i].y,q[i].l);
			flag=1;
			v[i]=1;
		}
		if (!flag) break;
	}
	if (f1[aim]<f2[aim])
	{
		printf("WIN\n");
		for (int i=1;i<=k;i++) printf("%d ",v[i]?q[i].l:q[i].r);
		return 0;
	}

	for (int i=1;i<=n;i++) v[i]=last[i]=0;
	num=0;
	for (int i=1;i<=m;i++) add(tmp[i].x,tmp[i].y,tmp[i].r);
	for (int i=1;i<=k;i++) add(q[i].x,q[i].y,q[i].r);

	while (1)
	{
		dij(s1,f1);dij(s2,f2);
		int flag=0;
		for (int i=1;i<=k;i++)
		if (!v[i]&&f1[q[i].x]<=f2[q[i].y])
		{
			add(q[i].x,q[i].y,q[i].l);
			flag=1;
			v[i]=1;
		}
		if (!flag) break;
	}
	if (f1[aim]<=f2[aim])
	{
		printf("DRAW\n");
		for (int i=1;i<=k;i++) printf("%d ",v[i]?q[i].l:q[i].r);
		return 0;
	}
	printf("LOSE\n");
	return 0;
}


#include<cstdio>
#include<iostream>
#include<queue>
#define FR first
#define SC second
#define MP make_pair
using namespace std;
const int N=10010,inf=1000000010;
struct rec  {int x,y,l,r;};
struct Edge {int y,z,ne;};
typedef pair<int,int> PII;
int n,m,k,num;
int s1,s2,aim;
int f1[N],f2[N],v[N];
rec tmp[N];
priority_queue<PII> Q;
rec q[N];
Edge e[100000];int last[N];
inline void add(int x,int y,int z)
{
	e[++num]=(Edge){y,z,last[x]};last[x]=num;
}
inline void dij(int S,int *f)
{
	for (int i=1;i<=n;i++) f[i]=inf;
	f[S]=0;
	while (!Q.empty()) Q.pop();
	Q.push(MP(0,S));
	while (!Q.empty())
	{
		PII tmp=Q.top();Q.pop();
		int now=tmp.SC,dis=tmp.FR;
		if (f[now]!=dis) continue;
		for (int j=last[now];j;j=e[j].ne)
		if (f[e[j].y]>dis+e[j].z)
		{
			f[e[j].y]=dis+e[j].z;
			Q.push(MP(f[e[j].y],e[j].y));
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d",&s1,&s2,&aim);
	for (int i=1;i<=m;i++)
	{
		scanf("%d%d%d",&tmp[i].x,&tmp[i].y,&tmp[i].r);
		add(tmp[i].x,tmp[i].y,tmp[i].r);
	}
	for (int i=1;i<=k;i++)
	{
		scanf("%d%d%d%d",&q[i].x,&q[i].y,&q[i].l,&q[i].r);
		add(q[i].x,q[i].y,q[i].r);
	}
	while (1)
	{
		dij(s1,f1);dij(s2,f2);
		int flag=0;
		for (int i=1;i<=k;i++)
		if (!v[i]&&f1[q[i].x]<f2[q[i].y])
		{
			add(q[i].x,q[i].y,q[i].l);
			flag=1;
			v[i]=1;
		}
		if (!flag) break;
	}
	if (f1[aim]<f2[aim])
	{
		printf("WIN\n");
		for (int i=1;i<=k;i++) printf("%d ",v[i]?q[i].l:q[i].r);
		return 0;
	}

	for (int i=1;i<=n;i++) v[i]=last[i]=0;
	num=0;
	for (int i=1;i<=m;i++) add(tmp[i].x,tmp[i].y,tmp[i].r);
	for (int i=1;i<=k;i++) add(q[i].x,q[i].y,q[i].r);

	while (1)
	{
		dij(s1,f1);dij(s2,f2);
		int flag=0;
		for (int i=1;i<=k;i++)
		if (!v[i]&&f1[q[i].x]<=f2[q[i].y])
		{
			add(q[i].x,q[i].y,q[i].l);
			flag=1;
			v[i]=1;
		}
		if (!flag) break;
	}
	if (f1[aim]<=f2[aim])
	{
		printf("DRAW\n");
		for (int i=1;i<=k;i++) printf("%d ",v[i]?q[i].l:q[i].r);
		return 0;
	}
	printf("LOSE\n");
	return 0;
}


#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include <iostream>
#include<vector>
#include<queue>
#define INF 1e15
#define LL long long
#define P pair<LL,int>
#define MP make_pair
#define M 200000
#define N 100000
using namespace std;
priority_queue<P> q;
struct node {
	int l, r, to, nx;
} e[M];
int head[N];
int ecnt;
int ans[N];
void addedge(int x, int y, int l, int r) {
	e[ecnt].l = l;
	e[ecnt].r = r;
	e[ecnt].to = y;
	e[ecnt].nx = head[x];
	head[x] = ecnt++;
}
LL d1[N], d2[N];
int n, m, k, s1, s2, f;
void gao(int bo) {
	while (!q.empty())
		q.pop();
	memset(ans, -1, sizeof(ans));
	for (int i = 0; i <= n; ++i)
		d1[i] = d2[i] = INF;
	d1[s1] = d2[s2] = 0;
	q.push(MP(0, s1));
	q.push(MP(0, s2));
	while (!q.empty()) {
		P ee = q.top();
		q.pop();
		LL va = -ee.first;
		int id = ee.second;
		if (va > d1[id] && va > d2[id])
			continue;
		bool ok;
		if (bo == 1) {
			if (d1[id] < d2[id])
				ok = true;
			else
				ok = false;
		} else {
			if (d1[id] <= d2[id])
				ok = true;
			else
				ok = false;
		}
		for (int i = head[id]; i != -1; i = e[i].nx) {
			int u = e[i].to;
			LL add;
			if (ok)
				add = e[i].l;
			else
				add = e[i].r;
			ans[i] = add;
			if (d1[u] > d1[id] + add) {
				d1[u] = d1[id] + add;
				q.push(MP(-d1[u], u));
			}
			if (d2[u] > d2[id] + add) {
				d2[u] = d2[id] + add;
				q.push(MP(-d2[u], u));
			}
		}
	}
}
int main() {
	scanf("%d%d%d", &n, &m, &k);
	scanf("%d%d%d", &s1, &s2, &f);
	memset(head, -1, sizeof(head));
	ecnt = 0;
	for (int i = 0; i < m; ++i) {
		int x, y, z;
		scanf("%d%d%d", &x, &y, &z);
		addedge(x, y, z, z);
	}
	for (int i = 0; i < k; ++i) {
		int x, y, l, r;
		scanf("%d%d%d%d", &x, &y, &l, &r);
		addedge(x, y, l, r);
	}
	gao(1);
	if (d1[f] < d2[f]) {
		puts("WIN");
		for (int i = m; i < m + k; ++i) {
			if (ans[i] == -1)
				ans[i] = e[i].l;
			printf("%d", ans[i]);
			if (i == m + k - 1)
				puts("");
			else
				printf(" ");
		}
		return 0;
	}
	gao(0);
	if (d1[f] == d2[f]) {
		puts("DRAW");
		for (int i = m; i < m + k; ++i) {
			if (ans[i] == -1)
				ans[i] = e[i].l;
			printf("%d", ans[i]);
			if (i == m + k - 1)
				puts("");
			else
				printf(" ");
		}
		return 0;
	}
	puts("LOSE");
	return 0;
}


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

typedef int arr32[200010];

arr32 q, c, next, g, st, et, e, slf, in, d1, d2, t;
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, int *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");
}