#include <bits/stdc++.h>
struct edge {
  int u, v, w, id, ans;
} a[100005];
struct edge1 {
  int to, nxt;
} e[200005];
int n, m, l, t, clo, num, tot, cnt, fi[100005], f[100005], dfn[100005],
    low[100005], z[100005], c[100005], d[100005], q[200005];
void add(int u, int v) {
  e[++cnt].to = v;
  e[cnt].nxt = fi[u];
  fi[u] = cnt;
}
bool comp(edge x, edge y) { return x.w < y.w; }
int find(int x) { return f[x] == x ? x : f[x] = find(f[x]); }
void targan(int x, int k) {
  dfn[x] = low[x] = ++clo;
  z[++tot] = x;
  for (int i = fi[x]; i; i = e[i].nxt)
    if (!dfn[e[i].to]) {
      targan(e[i].to, i ^ 1);
      low[x] = std::min(low[x], low[e[i].to]);
    } else if (k != i)
      low[x] = std::min(low[x], dfn[e[i].to]);
  if (dfn[x] == low[x]) {
    for (++num; z[tot] != x; c[z[tot--]] = num)
      ;
    --tot;
    c[x] = num;
  }
}
bool comp2(edge x, edge y) { return x.id < y.id; }
int main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 1; i <= m; ++i) scanf("%d%d%d\n", &a[i].u, &a[i].v, &a[i].w);
  for (int i = 1; i <= m; ++i) a[i].id = i;
  std::sort(a + 1, a + m + 1, comp);
  for (int i = 1; i <= n; ++i) f[i] = i;
  for (int i = 1; i <= m; ++i) {
    l = t = 0;
    for (int j = i; j <= m && a[j].w == a[i].w; ++j)
      if ((a[j].u = find(a[j].u)) != (a[j].v = find(a[j].v))) d[++l] = j;
    clo = num = tot = 0;
    cnt = 1;
    for (int j = 1; j <= l; ++j) {
      q[++t] = a[d[j]].u;
      q[++t] = a[d[j]].v;
      add(q[t - 1], q[t]);
      add(q[t], q[t - 1]);
    }
    for (int j = 1; j <= t; ++j)
      if (!dfn[q[j]]) targan(q[j], 0);
    for (int j = 1; j <= l; ++j)
      if (c[a[d[j]].u] == c[a[d[j]].v])
        a[d[j]].ans = 1;
      else
        a[d[j]].ans = 2;
    for (int j = 1; j <= t; ++j) fi[q[j]] = c[q[j]] = dfn[q[j]] = low[q[j]] = 0;
    if (find(a[i].u) != find(a[i].v)) f[find(a[i].v)] = find(a[i].u);
    for (; i <= m && a[i].w == a[i + 1].w; ++i)
      if (find(a[i + 1].u) != find(a[i + 1].v))
        f[find(a[i + 1].v)] = find(a[i + 1].u);
  }
  std::sort(a + 1, a + m + 1, comp2);
  for (int i = 1; i <= m; ++i)
    if (!a[i].ans)
      printf("none\n");
    else if (a[i].ans == 1)
      printf("at least one\n");
    else
      printf("any\n");
  return 0;
}
