#include <bits/stdc++.h>
using namespace std;
int const M = 2e5 + 10, M2 = 1e3 + 10, mod = 1e9 + 7, inf = 1e9 + 10;
vector<pair<pair<int, int>, pair<int, int> > > edg;
int good[M], p[M], sz[M], dp[M], h[M];
bool mark[M];
vector<int> adj[M], ed[M];
void dfs(int v, int l, int id) {
  mark[v] = 1;
  h[v] = h[l] + 1;
  dp[v] = h[v];
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (!mark[u])
      dfs(u, v, ed[v][i]), dp[v] = min(dp[v], dp[u]);
    else if (h[u] < h[v]) {
      if (ed[v][i] == id) continue;
      dp[v] = min(dp[v], h[u]);
    }
  }
  if (id != -1 && dp[v] == h[v]) good[id] = 2;
}
int fp(int x) {
  while (p[x]) x = p[x];
  return x;
}
void mrg(int x, int y) {
  if (sz[x] < sz[y]) swap(x, y);
  p[y] = x;
  sz[x] += sz[y];
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) sz[i] = 1;
  for (int i = 1; i <= m; i++) {
    int a, b, w;
    cin >> a >> b >> w;
    edg.push_back(make_pair(make_pair(w, i), make_pair(a, b)));
  }
  sort(edg.begin(), edg.end());
  int pnt = 0;
  for (int i = 0; i < edg.size(); i++) {
    while (edg[i].first.first == edg[pnt + 1].first.first &&
           pnt + 1 < edg.size())
      pnt++;
    for (int j = i; j <= pnt; j++) {
      int v = edg[j].second.first, u = edg[j].second.second;
      v = fp(v), u = fp(u);
      if (v == u) continue;
      mark[v] = 0, mark[u] = 0, adj[v].clear(), adj[u].clear(), ed[v].clear(),
      ed[u].clear();
    }
    for (int j = i; j <= pnt; j++) {
      int v = edg[j].second.first, u = edg[j].second.second;
      v = fp(v), u = fp(u);
      if (v == u) continue;
      adj[v].push_back(u);
      adj[u].push_back(v);
      ed[v].push_back(edg[j].first.second);
      ed[u].push_back(edg[j].first.second);
      good[edg[j].first.second] = 1;
    }
    for (int j = i; j <= pnt; j++) {
      int v = fp(edg[j].second.first), u = fp(edg[j].second.second);
      if (!mark[v]) dfs(v, 0, -1);
      if (!mark[u]) dfs(u, 0, -1);
    }
    for (int j = i; j <= pnt; j++) {
      int v = fp(edg[j].second.first), u = fp(edg[j].second.second);
      if (v == u) continue;
      mrg(v, u);
    }
    i = pnt;
  }
  for (int i = 1; i <= m; i++) {
    if (!good[i])
      cout << "none";
    else if (good[i] == 1)
      cout << "at least one";
    else
      cout << "any";
    cout << "\n";
  }
}
