#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 5, M = 1e6 + 6, inf = 1e9;
vector<pair<long, long> > gv[maxn];
vector<pair<pair<long, long>, long long> > edge[M];
long long n, m, par[maxn], h[maxn];
long long ans[maxn];
bool mark[maxn];
vector<long long> nmd;
long gpc(long v) { return par[v] < 0 ? v : par[v] = gpc(par[v]); }
void uni(long long v, long long u) {
  u = gpc(u);
  v = gpc(v);
  if (v == u) return;
  if (par[u] < par[v]) swap(v, u);
  par[v] += par[u];
  par[u] = v;
}
long long dfs(long long v, long long p = -1) {
  mark[v] = true;
  long long res = inf;
  for (auto u : gv[v])
    if (u.second != p) {
      if (!mark[u.first]) {
        h[u.first] = h[v] + 1;
        long long r = dfs(u.first, u.second);
        res = min(res, r);
        if (r <= h[v]) ans[u.second] = 1;
      } else {
        res = min(res, h[u.first]);
        ans[u.second] = 1;
      }
    }
  return res;
}
int main() {
  memset(par, -1, sizeof par);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long u, v, w;
    cin >> v >> u >> w;
    v--;
    u--;
    edge[w].push_back({{v, u}, i});
  }
  for (int i = 0; i < M; i++) {
    for (auto e : edge[i]) {
      long long u = gpc(e.first.first);
      long long v = gpc(e.first.second);
      if (u == v) {
        ans[e.second] = 2;
        continue;
      }
      gv[u].push_back({v, e.second});
      gv[v].push_back({u, e.second});
      nmd.push_back(u);
      nmd.push_back(v);
    }
    for (auto i : nmd)
      if (!mark[i]) {
        h[i] = 0;
        dfs(i);
      }
    for (auto e : edge[i]) uni(e.first.first, e.first.second);
    for (auto i : nmd) {
      mark[i] = false;
      gv[i].clear();
    }
    nmd.clear();
  }
  for (int i = 0; i < m; i++) {
    if (ans[i] == 0)
      cout << "any\n";
    else if (ans[i] == 1)
      cout << "at least one\n";
    else
      cout << "none\n";
  }
}
