#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(const T &a) {
  return a * a;
}
template <typename T>
inline int nread(vector<T> &a) {
  int n;
  cin >> n;
  a.clear();
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  return n;
}
struct edge {
  int s, e, c, num, st;
};
int lsc(edge a, edge b) { return a.c < b.c; }
int lsnum(edge a, edge b) { return a.num < b.num; }
vector<int> dsu;
int getp(int k) {
  if (dsu[dsu[k]] != dsu[k]) dsu[k] = getp(dsu[k]);
  return dsu[k];
}
void join(int a, int b) {
  if (rand() % 2)
    dsu[getp(a)] = getp(b);
  else
    dsu[getp(b)] = getp(a);
}
vector<edge> gr;
vector<vector<int> > ngr, from;
vector<int> tin, fup, used;
int grtime;
void dfs(int u, int p = -1) {
  if (used[u]) return;
  used[u] = 1;
  tin[u] = grtime++;
  fup[u] = tin[u];
  int back = 0;
  for (int i = 0; i < ngr[u].size(); i++) {
    int v = ngr[u][i];
    if (v == p && !back) {
      back = 1;
      continue;
    }
    if (used[v]) {
      fup[u] = min(fup[u], tin[v]);
    } else {
      dfs(v, u);
      fup[u] = min(fup[u], fup[v]);
      if (fup[v] > tin[u]) {
        gr[from[u][i]].st = 2;
      }
    }
  }
}
void bridges() {
  tin.assign(ngr.size(), 0);
  fup.assign(ngr.size(), 0);
  used.assign(ngr.size(), 0);
  grtime = 0;
  for (int i = 0; i < ngr.size(); i++) {
    if (!used[i]) dfs(i);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  gr.resize(m);
  for (int i = 0; i < n; i++) dsu.push_back(i);
  for (int i = 0; i < m; i++) {
    cin >> gr[i].s >> gr[i].e >> gr[i].c;
    gr[i].s--;
    gr[i].e--;
    gr[i].num = i;
    gr[i].st = 0;
  }
  sort(gr.begin(), gr.end(), lsc);
  for (int i = 0; i < m;) {
    int j = i;
    while (gr[i].c == gr[j].c) j++;
    map<int, int> vert;
    ngr.clear();
    from.clear();
    for (int k = i; k < j; k++) {
      int ps = getp(gr[k].s);
      int pe = getp(gr[k].e);
      if (ps != pe) {
        gr[k].st = 1;
        if (!vert.count(ps)) {
          vert[ps] = ngr.size();
          ngr.push_back(vector<int>());
          from.push_back(vector<int>());
        }
        if (!vert.count(pe)) {
          vert[pe] = ngr.size();
          ngr.push_back(vector<int>());
          from.push_back(vector<int>());
        }
        ngr[vert[ps]].push_back(vert[pe]);
        ngr[vert[pe]].push_back(vert[ps]);
        from[vert[ps]].push_back(k);
        from[vert[pe]].push_back(k);
      }
    }
    bridges();
    for (int k = i; k < j; k++) join(gr[k].s, gr[k].e);
    i = j;
  }
  sort(gr.begin(), gr.end(), lsnum);
  for (int i = 0; i < m; i++) {
    if (gr[i].st == 0)
      cout << "none";
    else if (gr[i].st == 1)
      cout << "at least one";
    else
      cout << "any";
    cout << endl;
  }
}
