#include <bits/stdc++.h>
using namespace std;
struct unionset {
  int ud[(200000)];
  void init() { memset(ud, -1, sizeof(ud)); }
  int root(int x) { return ud[x] < 0 ? x : ud[x] = root(ud[x]); }
  bool set(int x, int y) {
    x = root(x);
    y = root(y);
    if (x != y) {
      if (ud[y] < ud[x]) std::swap(x, y);
      ud[x] += ud[y];
      ud[y] = x;
    }
    return x != y;
  }
} us;
int n, m, as[(200000)], bs[(200000)], ans[(200000)];
pair<int, int> es[(200000)];
vector<pair<int, int> > g[(200000)];
int q, ord[(200000)];
int rec(int at, int pre) {
  ord[at] = q++;
  int h = ord[at];
  for (int i = 0; i < (int)(g[at].size()); i++) {
    const int to = g[at][i].first;
    if (to == pre) continue;
    int th = ord[to];
    if (th == -1) {
      th = rec(to, at);
      if (ord[at] < th) ans[g[at][i].second] = 1;
    }
    h = min(h, th);
  }
  return h;
}
const char *msg[] = {"at least one", "any", "none"};
int main() {
  us.init();
  memset(ord, -1, sizeof(ord));
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (int)(m); i++) {
    scanf("%d%d%d", as + i, bs + i, &es[i].first);
    as[i]--, bs[i]--;
    es[i].second = i;
  }
  sort(es, es + m);
  int cur = 0;
  while (cur < m) {
    int nxt = cur;
    while (nxt < m && es[cur].first == es[nxt].first) nxt++;
    vector<int> v;
    for (int i = cur; i < nxt; i++) {
      const int ix = es[i].second;
      const int a = us.root(as[ix]), b = us.root(bs[ix]);
      if (a == b)
        ans[ix] = 2;
      else {
        v.push_back(a);
        v.push_back(b);
        g[a].push_back(make_pair(b, ix));
        g[b].push_back(make_pair(a, ix));
      }
    }
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    for (int i = 0; i < (int)(v.size()); i++)
      if (ord[v[i]] == -1) {
        q = 0;
        rec(v[i], -1);
      }
    for (int i = 0; i < (int)(v.size()); i++) {
      const int ix = v[i];
      sort(g[ix].begin(), g[ix].end());
      for (int j = 0; j < (int)(g[ix].size() - 1); j++) {
        if (g[ix][j].first == g[ix][j + 1].first) {
          ans[g[ix][j].second] = ans[g[ix][j + 1].second] = 0;
        }
      }
      ord[ix] = -1;
      g[ix].clear();
    }
    for (int i = cur; i < nxt; i++) {
      const int a = as[es[i].second], b = bs[es[i].second];
      us.set(a, b);
    }
    cur = nxt;
  }
  for (int i = 0; i < (int)(m); i++) puts(msg[ans[i]]);
  return 0;
}
