#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, M = 5e5 + 10, INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int n, m, k, idx, fa[N], vis[N], dfn[N], low[N], bridge[N];
int cnt, h[N], ans[N];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
struct Edge {
  int u, v, w, id;
  bool operator<(const Edge &rhs) const { return w < rhs.w; }
} e[N];
struct edge {
  int to, next, id;
} ed[N];
void add(int u, int v, int id) {
  ed[cnt].to = v;
  ed[cnt].next = h[u];
  ed[cnt].id = id;
  h[u] = cnt++;
}
void tarjan(int x, int edge) {
  low[x] = dfn[x] = ++idx;
  for (int i = h[x]; ~i; i = ed[i].next) {
    int v = ed[i].to;
    if (!dfn[v]) {
      tarjan(v, i);
      low[x] = min(low[x], low[v]);
      if (low[v] > dfn[x]) ans[ed[i].id] = 1;
    } else if (i != (edge ^ 1))
      low[x] = min(low[x], dfn[v]);
  }
}
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1; i <= m; i++) cin >> e[i].u >> e[i].v >> e[i].w, e[i].id = i;
  sort(e + 1, e + m + 1);
  for (int i = 1; i <= m; i++) {
    int l = i, r = i;
    while (e[l].w == e[r].w) r++;
    for (int k = l; k < r; k++) {
      int u = find(e[k].u), v = find(e[k].v);
      if (u != v) {
        dfn[u] = dfn[v] = low[u] = low[v] = idx = cnt = 0;
        h[u] = h[v] = -1;
      }
    }
    for (int k = l; k < r; k++) {
      int u = find(e[k].u), v = find(e[k].v);
      if (u != v) {
        add(u, v, e[k].id), add(v, u, e[k].id);
        ans[e[k].id] = 2;
      }
    }
    for (int k = l; k < r; k++) {
      if (!dfn[find(e[k].u)]) tarjan(find(e[k].u), 0);
    }
    for (int k = l; k < r; k++)
      if (find(e[k].u) != find(e[k].v)) fa[find(e[k].u)] = find(e[k].v);
    i = r - 1;
  }
  for (int i = 1; i <= m; i++) {
    if (ans[i] == 1)
      printf("any\n");
    else if (ans[i] == 2)
      printf("at least one\n");
    else
      printf("none\n");
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
