#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 * 1000 + 10;
int n, m, par[MAXN], ranc[MAXN], ans[MAXN], x[MAXN], y[MAXN], h[MAXN],
    mnh[MAXN], parind[MAXN];
vector<pair<int, int> > adj[MAXN], unim;
vector<int> ver;
set<pair<int, int> > e;
bool visit[MAXN];
int find(int a) {
  if (a == par[a]) return a;
  return par[a] = find(par[a]);
}
void uni(int a, int b) {
  int r1 = find(a), r2 = find(b);
  if (r1 == r2) return;
  if (ranc[r1] < ranc[r2]) swap(r1, r2);
  par[r2] = r1;
  if (ranc[r1] == ranc[r2]) ranc[r1]++;
  return;
}
void dfs(int v) {
  visit[v] = true;
  mnh[v] = h[v];
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int u = adj[v][i].first, ind = adj[v][i].second;
    if (!visit[u]) {
      h[u] = h[v] + 1;
      parind[u] = ind;
      dfs(u);
      mnh[v] = min(mnh[v], mnh[u]);
    } else if (ind != parind[v])
      mnh[v] = min(mnh[v], h[u]);
  }
  if (mnh[v] >= h[v] && parind[v] != -1) ans[parind[v]]++;
  return;
}
void dfsall() {
  for (int i = 0; i < (int)ver.size(); i++)
    if (!visit[ver[i]]) dfs(ver[i]);
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  int w;
  for (int i = 0; i < m; i++) {
    cin >> x[i] >> y[i] >> w;
    x[i]--, y[i]--;
    e.insert({w, i});
  }
  for (int i = 1; i < n; i++) par[i] = i;
  while (!e.empty()) {
    int mn = e.begin()->first;
    while (!e.empty() && e.begin()->first == mn) {
      int ind = e.begin()->second, r1 = find(x[ind]), r2 = find(y[ind]);
      e.erase(*e.begin());
      if (r1 == r2) continue;
      unim.push_back({r1, r2});
      ans[ind]++;
      ver.push_back(r1);
      ver.push_back(r2);
      h[r1] = 0, h[r2] = 0, visit[r1] = false, visit[r2] = false,
      parind[r1] = -1, parind[r2] = -1;
      adj[r1].push_back({r2, ind});
      adj[r2].push_back({r1, ind});
    }
    dfsall();
    while (!ver.empty()) {
      adj[ver.back()].clear();
      ver.pop_back();
    }
    while (!unim.empty()) {
      uni(unim.back().first, unim.back().second);
      unim.pop_back();
    }
  }
  for (int i = 0; i < m; i++) {
    if (ans[i] == 0)
      cout << "none" << endl;
    else if (ans[i] == 1)
      cout << "at least one" << endl;
    else
      cout << "any" << endl;
  }
  return 0;
}
