#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m, result[N], dsu[N];
map<pair<int, int>, int> mp;
struct edge {
  int u, v, w, id;
} edges[N];
bool comp(edge& a, edge& b) { return a.w < b.w; }
int root(int v) { return dsu[v] < 0 ? v : v = root(dsu[v]); }
struct Graph {
  int ids[N], lows[N], cnt = 0;
  vector<pair<int, int>> adj[N];
  vector<int> nodes;
  bool check[N];
  void clear() {
    for (int i = 0; i < nodes.size(); i++)
      ids[nodes[i]] = lows[nodes[i]] = check[nodes[i]] = 0,
      adj[nodes[i]].clear();
    nodes.clear();
    cnt = 0;
  }
  void add(int u, int v, int id) {
    adj[u].push_back({v, id});
    adj[v].push_back({u, id});
    if (!check[u]) nodes.push_back(u), check[u] = true;
    if (!check[v]) nodes.push_back(v), check[v] = true;
  }
  void dfs(int at, int par) {
    ids[at] = lows[at] = ++cnt;
    for (auto p : adj[at]) {
      int to = p.first;
      if (!ids[to]) {
        dfs(to, at);
        lows[at] = min(lows[at], lows[to]);
        if (lows[to] > ids[at]) result[p.second] = 2;
      } else if (to != par)
        lows[at] = min(lows[at], lows[to]);
    }
  }
  void tarjan() {
    for (int i = 0; i < nodes.size(); i++) {
      if (!ids[nodes[i]]) dfs(nodes[i], 0);
    }
  }
} graph;
void solve_weight(int f, int l) {
  graph.clear(), mp.clear();
  for (int i = f; i <= l; i++) {
    int u = root(edges[i].u), v = root(edges[i].v);
    if (u == v)
      result[edges[i].id] = 1;
    else if (++mp[{min(u, v), max(u, v)}] == 1)
      graph.add(u, v, edges[i].id);
  }
  graph.tarjan();
  for (int i = f; i <= l; i++) {
    int u = root(edges[i].u), v = root(edges[i].v);
    if (u != v && mp[{min(u, v), max(u, v)}] > 1) result[edges[i].id] = 0;
  }
  for (int i = f; i <= l; i++) {
    int u = root(edges[i].u), v = root(edges[i].v);
    if (u != v) {
      if (v < u) swap(v, u);
      dsu[u] += dsu[v];
      dsu[v] = u;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) dsu[i] = -1;
  for (int i = 1; i <= m; i++) {
    cin >> edges[i].u >> edges[i].v >> edges[i].w;
    edges[i].id = i;
  }
  sort(edges + 1, edges + m + 1, comp);
  edges[0].w = edges[m + 1].w = -1;
  for (int i = 1, f; i <= m; i++) {
    if (edges[i].w != edges[i - 1].w) f = i;
    if (edges[i].w != edges[i + 1].w) solve_weight(f, i);
  }
  for (int i = 1; i <= m; i++) {
    if (result[i] == 1)
      cout << "none\n";
    else if (result[i] == 0)
      cout << "at least one\n";
    else
      cout << "any\n";
  }
  return 0;
}
