#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1e3 + 7;
int cnt, totw, cnte, cntt, size[N], st[N], ed[N], top[N], fa[N], Fa[N], fae[N],
    son[N], ans[N], w[N], rev[N], head[N], dep[N];
struct Edge {
  int fr, to, w, id;
} e[N * 2 + 1];
struct node {
  int ne, to, w, id;
} edg[N * 2 + 1];
void build(int u, int v, int w, int x) {
  ++cnt;
  cnt--;
  ++cnt;
  e[cnt].fr = u;
  e[cnt].to = v;
  e[cnt].w = w;
  e[cnt].id = x;
}
bool cmp(Edge a, Edge b) { return a.w < b.w; }
void adde(int u, int v, int w, int x) {
  ++cnte;
  edg[cnte].to = v;
  edg[cnte].w = w;
  edg[cnte].id = x;
  edg[cnte].ne = head[u];
  head[u] = cnte;
}
struct T {
  int l, r, ls, rs;
  int mx, id;
} t[N * 2 + 1];
struct qans {
  int mx, id;
  void init() {
    mx = 0;
    id = 0;
  }
};
bool operator<(qans a, qans b) {
  return a.mx < b.mx || (a.mx == b.mx && a.id < b.id);
}
void update(int now) {
  int ls = t[now].ls, rs = t[now].rs;
  if (t[ls].mx > t[rs].mx || (t[ls].mx == t[rs].mx && t[ls].id > t[rs].id))
    t[now].mx = t[ls].mx, t[now].id = t[ls].id;
  else
    t[now].mx = t[rs].mx, t[now].id = t[rs].id;
}
int segbuild(int l, int r) {
  int now = ++cntt;
  int mid = (l + r) >> 1;
  t[now].l = l, t[now].r = r;
  if (l == r) {
    t[now].mx = w[rev[l]];
    t[now].id = rev[l];
    return now;
  }
  t[now].ls = segbuild(l, mid);
  t[now].rs = segbuild(mid + 1, r);
  update(now);
  return now;
}
void mdf(int now, int p) {
  int mid = (t[now].l + t[now].r) >> 1;
  if (t[now].l == t[now].r) {
    t[now].id = 0;
    return;
  }
  if (p <= mid)
    mdf(t[now].ls, p);
  else
    mdf(t[now].rs, p);
  update(now);
  return;
}
qans query(int now, int l, int r) {
  int mid = (t[now].l + t[now].r) >> 1;
  qans ret;
  ret.init();
  if (t[now].l >= l && t[now].r <= r) {
    ret.mx = t[now].mx;
    ret.id = t[now].id;
    return ret;
  }
  if (l <= mid) ret = max(ret, query(t[now].ls, l, r));
  if (r > mid) ret = max(ret, query(t[now].rs, l, r));
  return ret;
}
void dfs1(int i) {
  size[i] = 1;
  for (int tmp = head[i]; tmp; tmp = edg[tmp].ne) {
    int v = edg[tmp].to;
    if (v == fa[i]) continue;
    dep[v] = dep[i] + 1;
    fa[v] = i;
    w[v] = edg[tmp].w;
    fae[v] = edg[tmp].id;
    dfs1(v);
    size[i] += size[v];
    if (size[son[i]] < size[v]) son[i] = v;
  }
}
void dfs2(int i) {
  st[i] = ed[i] = ++totw;
  rev[st[i]] = i;
  if (son[i] == 0) return;
  int v = son[i];
  top[v] = top[i];
  dfs2(v);
  for (int tmp = head[i]; tmp != 0; tmp = edg[tmp].ne) {
    int v = edg[tmp].to;
    if (v == fa[i] || v == son[i]) continue;
    top[v] = v;
    dfs2(v);
  }
  ed[i] = totw;
}
int n, m;
int find(int x) { return x == Fa[x] ? x : Fa[x] = find(Fa[x]); }
void kruskal() {
  sort(e + 1, e + m + 1, cmp);
  for (int i = 1; i <= n; i++) Fa[i] = i;
  for (int i = 1; i <= m; i++) {
    int u = e[i].fr, v = e[i].to;
    int fu = find(u), fv = find(v);
    if (fu != fv) {
      Fa[fu] = fv;
      ans[e[i].id] = 2;
      adde(e[i].fr, e[i].to, e[i].w, e[i].id);
      adde(e[i].to, e[i].fr, e[i].w, e[i].id);
    }
  }
}
bool solve(int u, int v, int w) {
  bool ret = false;
  while (top[u] != top[v]) {
    if (dep[top[u]] < dep[top[v]]) swap(u, v);
    qans now;
    now = query(1, st[top[u]], st[u]);
    if (now.mx == w) {
      ret = true;
      while (now.id) {
        ans[fae[now.id]] = 1;
        mdf(1, st[now.id]);
        now = query(1, st[top[u]], st[u]);
      }
    }
    u = fa[top[u]];
  }
  if (u == v) return ret;
  if (dep[u] < dep[v]) swap(u, v);
  qans now;
  now = query(1, st[v] + 1, st[u]);
  if (now.mx == w) {
    ret = true;
    while (now.id) {
      ans[fae[now.id]] = 1;
      mdf(1, st[now.id]);
      now = query(1, st[v] + 1, st[u]);
    }
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    build(u, v, w, i);
  }
  kruskal();
  top[1] = 1;
  dfs1(1);
  dfs2(1);
  segbuild(1, n);
  for (int i = 1; i <= m; i++)
    if (!ans[e[i].id])
      if (solve(e[i].fr, e[i].to, e[i].w)) ans[e[i].id] = 1;
  for (int i = 1; i <= m; i++) {
    if (ans[i] == 0) puts("none");
    if (ans[i] == 1) puts("at least one");
    if (ans[i] == 2) puts("any");
  }
}
