You are given a connected weighted undirected graph without any loops and multiple edges. 

Let us remind you that a graph's spanning tree is defined as an acyclic connected subgraph of the given graph that includes all of the graph's vertexes. The weight of a tree is defined as the sum of weights of the edges that the given tree contains. The minimum spanning tree (MST) of a graph is defined as the graph's spanning tree having the minimum possible weight. For any connected graph obviously exists the minimum spanning tree, but in the general case, a graph's minimum spanning tree is not unique.

Your task is to determine the following for each edge of the given graph: whether it is either included in any MST, or included at least in one MST, or not included in any MST.

Input

The first line contains two integers n and m (2 ≤ n ≤ 105, <image>) — the number of the graph's vertexes and edges, correspondingly. Then follow m lines, each of them contains three integers — the description of the graph's edges as "ai bi wi" (1 ≤ ai, bi ≤ n, 1 ≤ wi ≤ 106, ai ≠ bi), where ai and bi are the numbers of vertexes connected by the i-th edge, wi is the edge's weight. It is guaranteed that the graph is connected and doesn't contain loops or multiple edges.

Output

Print m lines — the answers for all edges. If the i-th edge is included in any MST, print "any"; if the i-th edge is included at least in one MST, print "at least one"; if the i-th edge isn't included in any MST, print "none". Print the answers for the edges in the order in which the edges are specified in the input.

Examples

Input

4 5
1 2 101
1 3 100
2 3 2
2 4 2
3 4 1


Output

none
any
at least one
at least one
any


Input

3 3
1 2 1
2 3 1
1 3 2


Output

any
any
none


Input

3 3
1 2 1
2 3 1
1 3 1


Output

at least one
at least one
at least one

Note

In the second sample the MST is unique for the given graph: it contains two first edges.

In the third sample any two edges form the MST for the given graph. That means that each edge is included at least in one MST.
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Solution {
    static int n, m, timer = 0;

    static class Edge implements Comparable<Edge> {
        int from, to, w, id;

        public Edge(int F, int T, int W, int I) {
            from = F;
            to = T;
            w = W;
            id = I;
        }

        @Override
        public int compareTo(Edge e) {
            return w != e.w ? w - e.w : id - e.id;
        }
    }

    static class DSU {
        DSU par;
        int v;

        public DSU(int V) {
            v = V;
        }

        public DSU rep() {
            if (par == null)
                return this;
            par = par.rep();
            return par;
        }

        public int rv() {
            return rep().v;
        }
    }

    static TreeSet<Edge> E = new TreeSet<Edge>();

    public static void main(String[] args) throws Exception {
        new Thread(null, new Runnable() {

            @Override
            public void run() {
                try {
                    Solution.run();
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
    }

    private static void run() throws FileNotFoundException, IOException {
        // BufferedReader in = new BufferedReader(new FileReader("input.txt"));
        long t1 = System.currentTimeMillis();
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);

        StringTokenizer st = new StringTokenizer(in.readLine());
        n = Integer.parseInt(st.nextToken());
        m = Integer.parseInt(st.nextToken());

        for (int i = 0; i < m; i++) {
            st = new StringTokenizer(in.readLine());

            int from = Integer.parseInt(st.nextToken()) - 1, to = Integer.parseInt(st.nextToken()) - 1, w = Integer.parseInt(st.nextToken());
            Edge e = new Edge(from, to, w, i);
            E.add(e);
        }

        DSU[] d = new DSU[n];

        for (int i = 0; i < n; i++)
            d[i] = new DSU(i);

        String[] ans = new String[m];

        while (E.size() > 0) {
            int w = E.first().w;

            HashMap<Integer, HashSet<Integer>> G = new HashMap<Integer, HashSet<Integer>>();
            HashMap<Long, Integer> cnt = new HashMap<Long, Integer>();
            TreeSet<Edge> E2 = new TreeSet<Solution.Edge>();

            while (E.size() > 0 && E.first().w == w) {
                Edge e = E.first();
                int f = e.from, t = e.to, fr = d[f].rv(), tr = d[t].rv();

                if (fr == tr)
                    ans[e.id] = "none";
                else {
                    if (G.containsKey(fr))
                        G.get(fr).add(tr);
                    else {
                        HashSet<Integer> set = new HashSet<Integer>();
                        set.add(tr);
                        G.put(fr, set);
                    }

                    if (G.containsKey(tr))
                        G.get(tr).add(fr);
                    else {
                        HashSet<Integer> set = new HashSet<Integer>();
                        set.add(fr);
                        G.put(tr, set);
                    }

                    if (fr < tr) {
                        int tmp = fr;
                        fr = tr;
                        tr = tmp;
                    }
                    long val = 1000000L * fr + tr;
                    cnt.put(val, cnt.get(val) == null ? 1 : cnt.get(val) + 1);
                    E2.add(e);
                }

                E.remove(e);
            }

            HashMap<Integer, Integer> ti = new HashMap<Integer, Integer>(), fup = new HashMap<Integer, Integer>();
            HashSet<Integer> us = new HashSet<Integer>();
            HashSet<Long> bridges = new HashSet<Long>();

            timer = 0;
            for (Integer v : G.keySet())
                if (!us.contains(v))
                    dfs(v, -1, G, cnt, ti, fup, us, bridges);

            for (Edge e : E2) {
                int f = e.from, t = e.to, fr = d[f].rv(), tr = d[t].rv();
                if (fr < tr) {
                    int tmp = fr;
                    fr = tr;
                    tr = tmp;
                }
                long val = 1000000L * fr + tr;
                if (bridges.contains(val))
                    ans[e.id] = "any";
                else
                    ans[e.id] = "at least one";
            }

            for (Edge e : E2) {
                int f = e.from, t = e.to, fr = d[f].rv(), tr = d[t].rv();
                if (fr != tr)
                    d[f].rep().par = d[t].rep();
            }
        }

        for (String s : ans)
            out.println(s);

        // System.err.println(System.currentTimeMillis() - t1);

        out.close();
    }

    private static void dfs(int v, int p, HashMap<Integer, HashSet<Integer>> g, HashMap<Long, Integer> cnt, HashMap<Integer, Integer> ti, HashMap<Integer, Integer> fup,
            HashSet<Integer> us, HashSet<Long> bridges) {
        us.add(v);
        fup.put(v, timer);
        ti.put(v, timer);
        timer++;

        HashSet<Integer> adj = g.get(v);
        for (Integer to : adj) {
            if (to == p)
                continue;
            if (us.contains(to))
                fup.put(v, Math.min(fup.get(v), ti.get(to)));
            else {
                dfs(to, v, g, cnt, ti, fup, us, bridges);
                fup.put(v, Math.min(fup.get(to), fup.get(v)));
                if (fup.get(to) > ti.get(v)) {
                    int max = Math.max(v, to), min = Math.min(v, to);
                    long val = 1000000L * max + min;
                    if (cnt.get(val) == 1)
                        bridges.add(val);
                }
            }
        }
    }
}
