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.*;
import java.util.*;
public class EdgesInMST {
	static String[] ans;
	static ArrayList<Pair>[] adj;
	static int[] num, low;
	static boolean[] visited;
	static int time;
	public static void bridge(int n)
	{
		time=0;
		num= new int[n];
		visited = new boolean[n];
		low = new int[n];
		for (int i = 0; i < adj.length; i++) {
			if(!visited[i])
			{
				dfs(i, -1);
			}
		}
	}
	public static void dfs(int vertex, int parentEdge)
	{
        visited[vertex] = true; 
		num[vertex]=low[vertex]=time++;
		for(Pair p: adj[vertex])
		{
			if(!visited[p.vertex])
			{
				dfs(p.vertex, p.indx);
				low[vertex]=Math.min(low[vertex], low[p.vertex]);
				if(num[vertex]<low[p.vertex])
					ans[p.indx]="any";
			}
			else if(p.indx!=parentEdge)
			{
				low[vertex]=Math.min(low[vertex], num[p.vertex]);
			}
			
		}
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n= Integer.parseInt(st.nextToken());
		int m= Integer.parseInt(st.nextToken());
		//kruskal's algorithm
		ArrayList<Edge> arr = new ArrayList<Edge>();
		for (int i = 0; i < m; i++) {
			st = new StringTokenizer(br.readLine());
			int u = Integer.parseInt(st.nextToken())-1;
			int v= Integer.parseInt(st.nextToken())-1;
			int w = Integer.parseInt(st.nextToken());
			arr.add(new Edge(u, v, w,i));
		}
		Collections.sort(arr);
		DSU d = new DSU(n);
		ans = new String[m];
		for (int i = 0; i < arr.size(); i++) {
			int nr=0;
			HashMap<Integer, Integer> reps= new HashMap<Integer, Integer>();
			for (int j = i; j < arr.size(); j++) {
				int repU=d.findSet(arr.get(j).u);
				int repV=d.findSet(arr.get(j).v);
				if(repU!=repV)
				{
					if(!reps.containsKey(repU))
					{
						reps.put(repU, nr++);
					}
					if(!reps.containsKey(repV))
					{
						reps.put(repV, nr++);
					}
				}
				if(j==arr.size()-1 || arr.get(j).w!=arr.get(j+1).w)break;
			}
			adj= new ArrayList[nr];
			for (int j = 0; j < adj.length; j++) {
				adj[j]=new ArrayList<EdgesInMST.Pair>();
			}
			for (int j = i; j < arr.size(); j++) {
				int repU=d.findSet(arr.get(j).u);
				int repV=d.findSet(arr.get(j).v);
				if(repU==repV)
				{
					ans[arr.get(j).indx]="none";
				}
				else
				{
					adj[reps.get(repU)].add(new Pair(arr.get(j).indx, reps.get(repV)));
					adj[reps.get(repV)].add(new Pair(arr.get(j).indx, reps.get(repU)));
				}
				if(j==arr.size()-1 || arr.get(j).w!=arr.get(j+1).w)break;
			}
			bridge(nr);
			for (int j = i; j < arr.size(); j++) {
				if(!d.isSameSet(arr.get(j).u, arr.get(j).v))
				{
					d.union(arr.get(j).u, arr.get(j).v);
				}
				if(j==arr.size()-1 || arr.get(j).w!=arr.get(j+1).w){i=j;break;}
			}
		}
		for (int i = 0; i < ans.length; i++) {
			pw.println(ans[i]==null?"at least one":ans[i]);
		}
		pw.close();
	}
	static class Edge implements Comparable<Edge>
	{
		int indx, u, v,w;
		public Edge(int u, int v, int w, int indx)
		{
			this.indx=indx; this.u=u; this.v=v; this.w=w;
		}
		public int compareTo(Edge e) {
			return this.w-e.w;
		}	
	}
	static class Pair
	{
		int indx,vertex;
		public Pair(int indx, int vertex)
		{
			this.indx=indx;
			this.vertex=vertex;
		}	
	}
	static class DSU {
		int[] parent,size;
		
		public DSU(int N) {
			parent = new int[N];
			size = new int[N];
			for (int i = 0; i < parent.length; i++) {
				parent[i]=i;
				size[i]=1;
			}
		}
		
		public int findSet(int i)
		{
			if(parent[i]==i)return i;
			return parent[i]=findSet(parent[i]);
		}
		
		public boolean isSameSet(int i, int j)
		{
			return findSet(i)==findSet(j);
		}
		
		public int size(int i)
		{
			return size[findSet(i)];
		}
		
		public void union(int i, int j)
		{
			if(isSameSet(i, j))return;
			int I = findSet(i);
			int J = findSet(j);
			if(size[I]<=size[J])
			{
				size[J]+=size[I];
				parent[I]=parent[J];
			}
			else
			{
				size[I]+=size[J];
				parent[J]=parent[I];
			}
		}
	}
}
