#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int par[N], ans[N], v[N], u[N], w[N], a[N], h[N];
vector<pair<int, int> > adj[N];
vector<int> vec;
bool mark[N];
int n, m;
int getPar(int v) { return (par[v] == v ? v : par[v] = getPar(par[v])); }
void merge(int v, int u) {
  v = getPar(v);
  u = getPar(u);
  par[u] = v;
}
void add(int a, int b, int i) {
  if (a == b) return;
  vec.push_back(a);
  adj[a].push_back({b, i});
}
int dfs(int v, int ind) {
  mark[v] = true;
  int mn = h[v];
  for (auto [u, i] : adj[v]) {
    if (i == ind) continue;
    if (mark[u]) {
      mn = min(mn, h[u]);
      continue;
    }
    h[u] = h[v] + 1;
    int tmp = dfs(u, i);
    if (tmp > h[v]) ans[i] = 2;
    mn = min(mn, tmp);
  }
  return mn;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> v[i] >> u[i] >> w[i];
    v[i]--;
    u[i]--;
    a[i] = i;
  }
  sort(a, a + m, [&](int i, int j) { return w[i] < w[j]; });
  for (int i = 0; i < n; i++) par[i] = i;
  for (int i = 0; i < m;) {
    int j = i;
    for (; j < m && w[a[j]] == w[a[i]]; j++) {
      v[a[j]] = getPar(v[a[j]]);
      u[a[j]] = getPar(u[a[j]]);
      add(v[a[j]], u[a[j]], a[j]), add(u[a[j]], v[a[j]], a[j]);
    }
    for (; i < j; i++) merge(v[a[i]], u[a[i]]);
    for (auto v : vec)
      if (!mark[v]) dfs(v, m);
    for (auto v : vec) {
      for (auto [u, i] : adj[v])
        if (!ans[i]) ans[i] = 1;
      h[v] = 0;
      adj[v].clear();
      mark[v] = false;
      vec.clear();
    }
  }
  for (int i = 0; i < m; i++) {
    if (!ans[i])
      cout << "none\n";
    else
      cout << (--ans[i] ? "any" : "at least one") << '\n';
  }
}
