#include <bits/stdc++.h>
using namespace std;
int n, m, fa[100005], ans[100005];
struct edges {
  int u, v, w, i;
} es[100005];
bool cmpw(edges x, edges y) { return x.w < y.w; }
int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
struct edge {
  int nt, to, i;
} e[100005 << 1];
int cnt, h[100005];
void addedge(int u, int v, int i) {
  e[++cnt] = (edge){h[u], v, i};
  h[u] = cnt;
}
int idx, dfn[100005], top, stk[100005], low[100005];
void tarjan(int u, int ei) {
  dfn[u] = low[u] = ++idx;
  stk[++top] = u;
  for (int i = h[u], v; i; i = e[i].nt) {
    v = e[i].to;
    if (v != fa[v] || e[i].i == ei) continue;
    if (!dfn[v]) {
      tarjan(v, e[i].i);
      low[u] = min(low[u], low[v]);
      if (low[v] > dfn[u]) ans[e[i].i] = 1;
    } else {
      low[u] = min(low[u], dfn[v]);
    }
  }
  if (low[u] == dfn[u]) {
    while (stk[top + 1] != u) {
      fa[stk[top--]] = u;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i)
    scanf("%d%d%d", &es[i].u, &es[i].v, &es[i].w), es[i].i = i;
  for (int i = 1; i <= n; ++i) fa[i] = i;
  sort(es + 1, es + m + 1, cmpw);
  for (int i = 1, j = 1; i <= m; i = j) {
    for (int u, v; j <= m && es[j].w == es[i].w; ++j) {
      u = find(es[j].u), v = find(es[j].v);
      if (u == v)
        ans[es[j].i] = -1;
      else {
        addedge(u, v, es[j].i);
        addedge(v, u, es[j].i);
        dfn[u] = dfn[v] = 0;
      }
    }
    for (int k = i, u; k < j; ++k) {
      if (ans[es[k].i] > -1) {
        u = find(es[k].u);
        if (!dfn[u]) tarjan(u, 0);
      }
    }
    for (int k = i, u, v; k < j; ++k) {
      if (ans[es[k].i] > -1) {
        u = find(es[k].u), v = find(es[k].v);
        if (u != v) fa[u] = v;
      }
    }
  }
  for (int i = 1; i <= m; ++i)
    if (!ans[i])
      puts("at least one");
    else
      puts(ans[i] == 1 ? "any" : "none");
  return 0;
}
