#include <bits/stdc++.h>
using namespace std;
int n, m;
namespace EDGE {
struct edge {
  int u, v, w, num, ans;
} g[100010];
bool cmp1(edge a, edge b) { return a.w < b.w; }
bool cmp2(edge a, edge b) { return a.num < b.num; }
}  // namespace EDGE
namespace UNION {
int fa[100010];
int find(int u) { return (fa[u] == u ? u : fa[u] = find(fa[u])); }
void merge(int u, int v) { fa[find(v)] = find(u); }
}  // namespace UNION
namespace MST {
struct edge {
  int v, w, next;
} e[100010 << 1];
int eid, p[100010];
void insert(int u, int v, int w) {
  e[++eid] = {v, w, p[u]};
  p[u] = eid;
}
int idx, dfn[100010], low[100010];
map<pair<int, int>, int> more;
void tarjan(int u, int f) {
  dfn[u] = low[u] = ++idx;
  for (int i = p[u]; i; i = e[i].next) {
    int v = e[i].v;
    if (!dfn[v]) {
      tarjan(v, u);
      low[u] = min(low[u], low[v]);
      if (dfn[u] < low[v]) EDGE::g[e[i].w].ans = 1;
    } else if (f != v)
      low[u] = min(low[u], dfn[v]);
  }
}
void work(int l, int r) {
  for (int i = l; i <= r; ++i) {
    if (UNION::find(EDGE::g[i].u) == UNION::find(EDGE::g[i].v)) {
      EDGE::g[i].ans = 2;
      continue;
    }
    insert(UNION::find(EDGE::g[i].u), UNION::find(EDGE::g[i].v), i);
    insert(UNION::find(EDGE::g[i].v), UNION::find(EDGE::g[i].u), i);
    more[make_pair(UNION::find(EDGE::g[i].u), UNION::find(EDGE::g[i].v))]++,
        more[make_pair(UNION::find(EDGE::g[i].v), UNION::find(EDGE::g[i].u))]++;
  }
  for (int i = l; i <= r; ++i) {
    if (!dfn[UNION::find(EDGE::g[i].u)]) tarjan(UNION::find(EDGE::g[i].u), 0);
    if (!dfn[UNION::find(EDGE::g[i].v)]) tarjan(UNION::find(EDGE::g[i].v), 0);
  }
  for (int i = l; i <= r; ++i)
    if (more[make_pair(UNION::find(EDGE::g[i].u), UNION::find(EDGE::g[i].v))] >
        1)
      EDGE::g[i].ans = 0;
  for (int i = l; i <= r; ++i)
    UNION::merge(UNION::find(EDGE::g[i].u), UNION::find(EDGE::g[i].v));
  more.clear();
  for (int i = l; i <= r; ++i)
    p[UNION::find(EDGE::g[i].u)] = p[UNION::find(EDGE::g[i].v)] =
        dfn[UNION::find(EDGE::g[i].u)] = dfn[UNION::find(EDGE::g[i].v)] =
            low[UNION::find(EDGE::g[i].u)] = low[UNION::find(EDGE::g[i].v)] = 0;
  for (int i = 1; i <= eid; ++i) e[i] = {0, 0, 0};
  eid = 0;
}
}  // namespace MST
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) UNION::fa[i] = i;
  for (int i = 1; i <= m; ++i)
    cin >> EDGE::g[i].u >> EDGE::g[i].v >> EDGE::g[i].w, EDGE::g[i].num = i;
  sort(EDGE::g + 1, EDGE::g + m + 1, EDGE::cmp1);
  for (int i = 1; i <= m; ++i) {
    int l = i;
    while (EDGE::g[i].w == EDGE::g[i + 1].w) i++;
    MST::work(l, i);
  }
  sort(EDGE::g + 1, EDGE::g + m + 1, EDGE::cmp2);
  for (int i = 1; i <= m; ++i) {
    switch (EDGE::g[i].ans) {
      case 0:
        cout << "at least one" << endl;
        break;
      case 1:
        cout << "any" << endl;
        break;
      case 2:
        cout << "none" << endl;
        break;
    }
  }
  return 0;
}
