#include <bits/stdc++.h>
using namespace std;
struct edge {
  int x, y, dist, id;
  edge(int x = 0, int y = 0, int dist = 0) : x(x), y(y), dist(dist) {}
  bool operator<(const edge &b) const { return dist < b.dist; }
} edge[200200];
int root[200200];
int find_root(int h) { return h == root[h] ? h : root[h] = find_root(root[h]); }
int n, m, ans[200200], num[200200], T, flag[200200], node[200200], a[200200],
    b[200200];
int head[200200], nxt[200200 << 1], to[200200 << 1];
int dtime, dt[200200], low[200200], nn, mm;
bool vis[200200], bridge[200200];
inline int me(int x) { return x > mm ? x - mm : x; }
void init() {
  for (int i = 1; i <= nn; i++) head[i] = 0, dt[i] = 0;
  for (int i = 1; i <= mm; i++) vis[i] = 0, bridge[i] = 0;
}
void add_edge(int st, int en, int id) {
  to[id] = en;
  nxt[id] = head[st], head[st] = id;
}
void dfs(int x) {
  dt[x] = low[x] = ++dtime;
  for (int i = head[x]; i; i = nxt[i]) {
    if (vis[me(i)]) continue;
    vis[me(i)] = 1;
    int y = to[i];
    if (dt[y])
      low[x] = min(low[x], low[y]);
    else {
      dfs(y), low[x] = min(low[x], low[y]);
      if (low[y] > dt[x]) bridge[me(i)] = 1;
    }
  }
}
void get_bridge() {
  dtime = 0;
  for (int i = 1; i <= nn; i++)
    if (!dt[i]) dfs(i);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) root[i] = i;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d %d", &edge[i].x, &edge[i].y, &edge[i].dist);
    edge[i].id = i;
  }
  sort(edge + 1, edge + m + 1);
  int st = 1;
  while (st <= m) {
    int en = st;
    while (en < m && edge[en + 1].dist == edge[st].dist) en++;
    nn = 0, mm = 0;
    T++;
    for (int i = st; i <= en; i++) {
      int x = find_root(edge[i].x), y = find_root(edge[i].y);
      if (x != y) {
        if (flag[x] != T) node[x] = ++nn, flag[x] = T;
        if (flag[y] != T) node[y] = ++nn, flag[y] = T;
        num[++mm] = edge[i].id;
        a[mm] = node[x], b[mm] = node[y];
      }
    }
    init();
    for (int i = 1; i <= mm; i++) {
      add_edge(a[i], b[i], i);
      add_edge(b[i], a[i], i + mm);
    }
    get_bridge();
    for (int i = 1; i <= mm; i++) {
      if (bridge[i])
        ans[num[i]] = 2;
      else
        ans[num[i]] = 1;
    }
    for (int i = st; i <= en; i++) {
      int x = find_root(edge[i].x), y = find_root(edge[i].y);
      if (x != y) root[y] = x;
    }
    st = en + 1;
  }
  for (int i = 1; i <= m; i++)
    puts(ans[i] == 0 ? "none" : ans[i] == 1 ? "at least one" : "any");
  return 0;
}
