#include <bits/stdc++.h>
using namespace std;
template <class X>
inline void cmax(X& _, X __) {
  if (_ < __) _ = __;
}
template <class X>
inline void cmin(X& _, X __) {
  if (_ > __) _ = __;
}
template <class X>
inline int read(X& x) {
  int c = getchar(), f = (x = 0);
  while (~c && (c < 48 || c > 57)) {
    if (c == '-') {
      f = 1;
    }
    c = getchar();
  }
  if (!~c) return 0;
  while (c > 47 && c < 58) {
    x = x * 10 + (c ^ 48), c = getchar();
  }
  if (f) {
    x = -x;
  }
  return 1;
}
template <class X, class Y>
int read(X& x, Y& y) {
  return read(x) && read(y);
}
template <class X, class Y, class Z>
int read(X& x, Y& y, Z& z) {
  return read(x) && read(y, z);
}
const int maxn = 1e5 + 10, INF = 0x3f3f3f3f;
const long long LINF = (long long)INF << 32 | INF, mod = 1e9 + 7;
struct Edge {
  int u, v, w, id;
  Edge(int a, int b, int c, int d) : u(a), v(b), w(c), id(d) {}
  bool operator<(const Edge& T) const { return w < T.w; }
};
struct Node {
  int v, id;
  Node(int a, int b) : v(a), id(b) {}
};
vector<Edge> edge;
vector<Node> a[maxn];
int fa[maxn], ans[maxn], dfn[maxn], low[maxn], tot;
void Tarjan(int u, int pre) {
  dfn[u] = low[u] = ++tot;
  for (Node& x : a[u])
    if (x.id != pre) {
      if (!dfn[x.v]) {
        Tarjan(x.v, x.id);
        cmin(low[u], low[x.v]);
        if (low[x.v] > dfn[u]) ans[edge[x.id].id] = 2;
      } else
        cmin(low[u], dfn[x.v]);
    }
}
int Find(int x) { return fa[x] == x ? x : fa[x] = Find(fa[x]); }
int main() {
  int n, m;
  read(n, m);
  for (int i = 1; i <= (n); ++i) fa[i] = i;
  for (int i = 0; i < (m); ++i) {
    int u, v, w;
    read(u, v, w);
    edge.push_back(Edge(u, v, w, i));
  }
  sort(edge.begin(), edge.end());
  for (int i = 0; i < (m); ++i) {
    int nxt = i + 1;
    while (nxt != m && edge[nxt].w == edge[i].w) nxt++;
    for (int j = i; j < (nxt); ++j) {
      int x = Find(edge[j].u), y = Find(edge[j].v);
      if (x == y) continue;
      a[x].push_back(Node(y, j));
      a[y].push_back(Node(x, j));
      ans[edge[j].id] = 1;
    }
    for (int j = i; j < (nxt); ++j) {
      int x = Find(edge[j].u), y = Find(edge[j].v);
      if (x == y || dfn[x]) continue;
      Tarjan(x, -1);
    }
    for (int j = i; j < (nxt); ++j) {
      int x = Find(edge[j].u), y = Find(edge[j].v);
      if (x == y) continue;
      a[x].clear(), a[y].clear();
      dfn[x] = dfn[y] = 0;
      fa[x] = y;
    }
    i = nxt - 1;
  }
  for (int i = 0; i < (m); ++i)
    puts(ans[i] ? (ans[i] == 1 ? "at least one" : "any") : "none");
  return 0;
}
