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.
#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v, l, num;
  bool operator<(const edge a) const { return l < a.l; }
} e[100005];
int F[100005], n, m;
inline int getf(int k) { return F[k] == k ? k : (F[k] = getf(F[k])); }
struct node {
  int to, next, l, no;
} g[300021];
int h[100005];
int tot = 0, tmp = 0;
int to[100005], from[100005], a[100005], type[100005], at[100005];
inline void add(int u, int v, int l, int no) {
  tot++;
  g[tot].to = v;
  g[tot].next = h[u];
  g[tot].l = l;
  g[tot].no = no;
  h[u] = tot;
}
bool in[100005];
int siz[100005], son[100005], top[100005], d[100005], fa[100005];
inline void dfs_1(int k, int f) {
  siz[k] = 1;
  for (int i = h[k]; i; i = g[i].next) {
    int v = g[i].to;
    if (v == f) continue;
    d[v] = d[k] + 1;
    a[v] = g[i].l;
    at[v] = g[i].no;
    fa[v] = k;
    dfs_1(v, k);
    siz[k] += siz[v];
    if (siz[v] > siz[son[k]]) son[k] = v;
  }
}
inline void dfs_2(int k, int fa) {
  top[son[k]] = top[k];
  to[k] = ++tmp;
  from[tmp] = k;
  if (son[k] == 0) return;
  dfs_2(son[k], k);
  for (int i = h[k]; i > 0; i = g[i].next) {
    int v = g[i].to;
    if (v == fa || v == son[k]) continue;
    top[v] = v;
    dfs_2(v, k);
  }
}
int f[400005];
bool tag[400005];
inline void bt(int l, int r, int k) {
  if (l == r) {
    f[k] = a[from[l]];
    return;
  }
  int mid = (l + r) >> 1, t = k << 1;
  bt(l, mid, t);
  bt(mid + 1, r, t | 1);
  f[k] = max(f[t], f[t | 1]);
}
inline int query(int l, int r, int l1, int r1, int k) {
  if (l == l1 && r == r1) return f[k];
  int mid = (l + r) >> 1;
  if (r1 <= mid)
    return query(l, mid, l1, r1, (k << 1));
  else if (l1 > mid)
    return query(mid + 1, r, l1, r1, (k << 1 | 1));
  else {
    int t1 = query(l, mid, l1, mid, (k << 1)),
        t2 = query(mid + 1, r, mid + 1, r1, (k << 1 | 1));
    return max(t1, t2);
  }
}
inline void Tag(int l, int r, int l1, int r1, int k, int t) {
  if (f[k] < t) return;
  if (l == l1 && r == r1) {
    if (f[k] == t) {
      tag[k] = 1;
      return;
    }
    int mid = l + r >> 1;
    if (f[(k << 1)] >= t) Tag(l, mid, l, mid, (k << 1), t);
    if (f[(k << 1 | 1)] >= t) Tag(mid + 1, r, mid + 1, r, (k << 1 | 1), t);
    return;
  }
  int mid = l + r >> 1;
  if (r1 <= mid)
    Tag(l, mid, l1, r1, (k << 1), t);
  else if (l1 > mid)
    Tag(mid + 1, r, l1, r1, (k << 1 | 1), t);
  else
    Tag(l, mid, l1, mid, (k << 1), t),
        Tag(mid + 1, r, mid + 1, r1, (k << 1 | 1), t);
}
inline int q_path(int u, int v) {
  int ans = 0;
  while (top[u] ^ top[v]) {
    if (d[top[u]] < d[top[v]]) u ^= v, v ^= u, u ^= v;
    ans = max(ans, query(1, n, to[top[u]], to[u], 1));
    u = fa[top[u]];
  }
  if (to[u] == to[v]) return ans;
  if (to[u] > to[v]) u ^= v, v ^= u, u ^= v;
  ans = max(ans, query(1, n, to[u] + 1, to[v], 1));
  return ans;
}
inline void t_path(int u, int v, int tmp) {
  int ans = 100000;
  while (top[u] ^ top[v]) {
    if (d[top[u]] < d[top[v]]) u ^= v, v ^= u, u ^= v;
    Tag(1, n, to[top[u]], to[u], 1, tmp);
    u = fa[top[u]];
  }
  if (to[u] == to[v]) return;
  if (to[u] > to[v]) u ^= v, v ^= u, u ^= v;
  Tag(1, n, to[u] + 1, to[v], 1, tmp);
}
inline void pushdown(int l, int r, int k) {
  if (l == r) {
    if (tag[k]) type[at[from[l]]] = 2;
    return;
  }
  if (tag[k]) {
    if (f[(k << 1)] == f[k]) tag[(k << 1)] = 1;
    if (f[(k << 1 | 1)] == f[k]) tag[(k << 1 | 1)] = 1;
  }
  int mid = l + r >> 1;
  pushdown(l, mid, (k << 1));
  pushdown(mid + 1, r, (k << 1 | 1));
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v, l;
    scanf("%d%d%d", &e[i].u, &e[i].v, &e[i].l);
    e[i].num = i;
  }
  sort(e + 1, e + 1 + m);
  for (int i = 1; i <= n; i++) F[i] = i;
  int k = 1, tmp = 0;
  while (tmp < n - 1) {
    int t1 = getf(e[k].u), t2 = getf(e[k].v);
    if (t1 != t2) {
      in[k] = 1;
      add(e[k].u, e[k].v, e[k].l, e[k].num);
      add(e[k].v, e[k].u, e[k].l, e[k].num);
      F[t1] = t2;
      tmp++;
    }
    k++;
  }
  fa[1] = top[1] = 1;
  dfs_1(1, 0);
  dfs_2(1, 0);
  bt(1, n, 1);
  for (int i = 1; i <= m; i++) {
    type[e[i].num] = 1;
    if (!in[i]) {
      int tmp = q_path(e[i].u, e[i].v);
      if (e[i].l > tmp)
        type[e[i].num] = 3;
      else {
        type[e[i].num] = 2;
        t_path(e[i].u, e[i].v, tmp);
      }
    }
  }
  pushdown(1, n, 1);
  for (int i = 1; i <= m; i++)
    puts(type[i] == 1 ? "any" : (type[i] == 2 ? "at least one" : "none"));
  return 0;
}
