#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
struct edge {
  int x, y, w, id;
};
bool cmp(edge &a, edge &b) { return a.w < b.w; }
edge e[maxn], ne[maxn];
bool none[maxn], used[maxn];
int par[maxn], res[maxn], low[maxn], num[maxn], lab[maxn];
int n, m, cnt;
vector<int> adj[maxn], id[maxn];
void Input() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> e[i].x >> e[i].y >> e[i].w;
    e[i].id = i;
  }
}
int root(int x) {
  while (lab[x] > 0) x = lab[x];
  return x;
}
void Union(int r1, int r2) {
  if (lab[r1] > lab[r2]) {
    lab[r2] += lab[r1];
    lab[r1] = r2;
  } else {
    lab[r1] += lab[r2];
    lab[r2] = r1;
  }
}
void DFS(int u) {
  num[u] = ++cnt;
  low[u] = cnt;
  int v;
  for (int i = 0; i < (int)adj[u].size(); ++i) {
    if (used[id[u][i]]) continue;
    used[id[u][i]] = true;
    v = adj[u][i];
    if (num[v] == 0) {
      par[v] = u;
      DFS(v);
      low[u] = min(low[u], low[v]);
    } else
      low[u] = min(low[u], num[v]);
  }
}
void Solve() {
  sort(e + 1, e + m + 1, cmp);
  memset(lab, 255, sizeof(lab));
  e[m + 1].w = -1;
  int l = 1, r1, r2, s, u, v;
  bool any;
  for (int i = 1; i <= m; ++i) {
    if (e[i].w != e[i + 1].w) {
      for (int j = l; j <= i; ++j) {
        r1 = root(e[j].x);
        r2 = root(e[j].y);
        if (r1 == r2) none[j] = true;
        ne[j].x = r1;
        ne[j].y = r2;
        adj[r1].clear();
        adj[r2].clear();
        id[r1].clear();
        id[r2].clear();
      }
      for (int j = l; j <= i; ++j) {
        adj[ne[j].x].push_back(ne[j].y);
        id[ne[j].x].push_back(j);
        adj[ne[j].y].push_back(ne[j].x);
        id[ne[j].y].push_back(j);
        num[ne[j].x] = 0;
        num[ne[j].y] = 0;
        par[ne[j].x] = 0;
        par[ne[j].y] = 0;
      }
      for (int j = l; j <= i; ++j) {
        if (par[ne[j].x] == 0) {
          par[ne[j].x] = -1;
          DFS(ne[j].x);
        }
        if (par[ne[j].y] == 0) {
          par[ne[j].y] = -1;
          DFS(ne[j].y);
        }
      }
      any = true;
      for (int j = l; j <= i; ++j)
        if (!none[j]) {
          r1 = root(e[j].x);
          r2 = root(e[j].y);
          if (r1 != r2)
            Union(r1, r2);
          else
            any = false;
        }
      if (any)
        s = 1;
      else
        s = 0;
      for (int j = l; j <= i; ++j)
        if (none[j])
          res[e[j].id] = -1;
        else
          res[e[j].id] = s;
      cnt = 0;
      for (int j = l; j <= i; ++j) {
        u = ne[j].x;
        v = ne[j].y;
        if (par[u] == v) swap(u, v);
        if (par[v] == u && low[v] >= num[v]) {
          res[e[j].id] = 1;
        }
      }
      l = i + 1;
    }
  }
  for (int i = 1; i <= m; ++i)
    if (res[i] == 1)
      cout << "any\n";
    else if (res[i] == 0)
      cout << "at least one\n";
    else
      cout << "none\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Input();
  Solve();
  return 0;
}
