#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, m, cnt = 0, dfn[maxn], low[maxn], father[maxn];
vector<pair<int, int>> g[maxn];
struct node {
  int u, v, w, id, ans;
} s[maxn];
bool cmp(const node &a, const node &b) { return a.w < b.w; }
bool cmp1(const node &a, const node &b) { return a.id < b.id; }
int findfather(int x) {
  if (x == father[x]) return x;
  int i = findfather(father[x]);
  father[x] = i;
  return i;
}
void tarjan(int x, int fa) {
  low[x] = dfn[x] = ++cnt;
  for (auto to : g[x]) {
    if (fa == to.second) continue;
    if (!dfn[to.first]) {
      tarjan(to.first, to.second);
      low[x] = min(low[x], low[to.first]);
      if (low[to.first] > dfn[x]) s[to.second].ans = 2;
    } else
      low[x] = min(low[x], low[to.first]);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i <= n; ++i) father[i] = i;
  for (int i = 1; i <= m; ++i)
    scanf("%d%d%d", &s[i].u, &s[i].v, &s[i].w), s[i].id = i;
  sort(s + 1, s + 1 + m, cmp);
  int i = 1, j;
  while (i <= m) {
    j = i;
    while (j <= m && s[i].w == s[j].w) j++;
    for (int k = i; k < j; ++k) {
      int fa = findfather(s[k].u), fb = findfather(s[k].v);
      if (fa == fb) continue;
      g[fa].push_back({fb, k});
      g[fb].push_back({fa, k});
      s[k].ans = 1;
    }
    for (int k = i; k < j; ++k) {
      int fa = findfather(s[k].u), fb = findfather(s[k].v);
      if (fa == fb || dfn[fa]) continue;
      tarjan(fa, -1);
    }
    for (int k = i; k < j; ++k) {
      int fa = findfather(s[k].u), fb = findfather(s[k].v);
      if (fa == fb) continue;
      g[fa].clear();
      g[fb].clear();
      dfn[fa] = dfn[fb] = 0;
      father[fa] = fb;
    }
    i = j;
  }
  sort(s + 1, s + 1 + m, cmp1);
  for (int i = 1; i <= m; ++i)
    if (s[i].ans == 0)
      printf("none\n");
    else if (s[i].ans == 1)
      printf("at least one\n");
    else
      printf("any\n");
}
