#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v, w, ind;
  edge(){};
  edge(int u, int v, int w, int ind) : u(u), v(v), w(w), ind(ind){};
  bool operator<(edge x) const { return w < x.w; }
};
const int MAXN = 1000 * 100 + 10;
vector<edge> e;
vector<pair<int, int> > vec[MAXN];
int p[MAXN], mark[MAXN], ans[MAXN], up[MAXN], h[MAXN];
int k = 1;
int par(int v) { return p[v] = ((v == p[v]) ? v : par(p[v])); }
void merge(int u, int v) {
  u = par(u), v = par(v);
  p[u] = v;
}
int dfs(int v, int hh, int ep) {
  mark[v] = k;
  h[v] = hh;
  up[v] = h[v];
  for (int i = 0; i < (int)vec[v].size(); i++)
    if (mark[vec[v][i].first] != k)
      up[v] = min(up[v], dfs(vec[v][i].first, hh + 1, vec[v][i].second));
    else if (ep != vec[v][i].second)
      up[v] = min(up[v], h[vec[v][i].first]);
  if (up[v] >= h[v] && ep != -1) ans[ep] = 2;
  return up[v];
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    a--, b--;
    e.push_back(edge(a, b, c, i));
  }
  sort(e.begin(), e.end());
  for (int i = 0; i < n; i++) p[i] = i;
  for (int j = 0; j < m; j++) {
    k = j + 1;
    vector<edge> e2;
    int x = e[j].w;
    while (j < m && e[j].w == x) {
      if (par(e[j].u) != par(e[j].v)) e2.push_back(e[j]);
      j++;
    }
    j--;
    for (int i = 0; i < (int)e2.size(); i++) {
      ans[e2[i].ind] = 1;
      vec[p[e2[i].u]].push_back(make_pair(p[e2[i].v], e2[i].ind));
      vec[p[e2[i].v]].push_back(make_pair(p[e2[i].u], e2[i].ind));
    }
    for (int i = 0; i < (int)e2.size(); i++)
      if (mark[p[e2[i].u]] != k) dfs(p[e2[i].u], 0, -1);
    for (int i = 0; i < (int)e2.size(); i++) {
      vec[p[e2[i].u]].clear();
      vec[p[e2[i].v]].clear();
    }
    for (int i = 0; i < (int)e2.size(); i++) merge(e2[i].u, e2[i].v);
  }
  for (int i = 0; i < m; i++)
    if (ans[i] == 0)
      cout << "none\n";
    else if (ans[i] == 1)
      cout << "at least one\n";
    else
      cout << "any\n";
}
