#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define mp make_pair
vector <pair <int, pair <int, int> > > g;
vector<int> lc[100001], lp[100001];
int stat[100001];
void mst (int n, int m)
{
    vector <int> tree_id(n + 1);
    for (int i = 0; i <= n; i++)
            tree_id[i] = i;

    sort (g.begin(), g.end());
    for (int i = 0; i < m; i++) {
        int a, b, c;
        a = g[i].second.first;b = g[i].second.second; c = g[i].first;
        cout<<a<<" "<<b<<" "<<tree_id[a]<<" "<<tree_id[b]<<endl;
        if ((tree_id[a] == tree_id[b]) && lc[tree_id[a]].size() && (lc[tree_id[a]][0] == c)) {
            stat[i] = 1;
            int id = tree_id[a];
            for (int k = 0; k < lp[tree_id[a]].size(); k++)
                stat[lp[id][k]] = 1;
            }
         if (tree_id[a] != tree_id[b]) {
             int id = tree_id[a];
             stat[i] = 2;
             if (lc[id].size() && lc[id][0] == c) {
                 lc[id].push_back(c);
                 lp[id].push_back(i);
              }
             else {
              lc[id].clear(); lc[id].push_back(c);
              lp[id].clear(); lp[id].push_back(i);
              }
             int old = tree_id[b], nw = tree_id[a];
             for (int j = 0; j <= n; j++)
                 if (tree_id[j] == old) tree_id[j] = nw;
            }
    }
 }
 bool comp(int a, int b)
 {
    return g[a] < g[b];
 }
 int rev[100001], mapping[100001];
int main ()
{
    int n, m;
    cin>>n>>m;
    for (int i = 0; i < m; i++) {
        int f, t, c;
        cin>>f>>t>>c;
        g.push_back(mp(c,mp(f,t)));
        }
      for (int i = 0; i < m; i++)
          rev[i] = i;
     sort (rev, rev + m, comp);
     for (int i = 0; i < m; i++)
         mapping[rev[i]] = i;
     mst(n, m);
     for (int i = 0; i < m; i++) {
         int m = mapping[i];
         if (stat[m] == 1)
             cout<<"at least one"<<endl;
         else if (stat[m] == 2)
             cout<<"any"<<endl;
          else
              cout<<"none"<<endl;
      }
    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<cstdio>
using namespace std;
#define MAX 110001
int p[MAX];
int find_set (int x)
{
  if (p[x] != x)
    p[x] = find_set(p[x]);
  return p[x];
}
void link (int x, int y)
{
  p[y] = x;
}
struct edge_t
{
  int a, b;
  int w, id;
} edge[MAX];
int comp (edge_t a, edge_t b)
{
  return a.w < b.w;
}
int res[MAX], mark[MAX];
struct graph_t
{
  int num, low;
  int p, pi;
} g[MAX];
int first_from[MAX], next[MAX], ed[MAX], id[MAX], total;
int add_edge (int a, int b, int i)
{
  ed[++total] = b;
  next[total] = first_from[a];
  first_from[a] = total;
  id[total] = i + 1;

}
int visit;
void bridge (int x)
{
  g[x].num = ++visit;
  g[x].low = g[x].num;
  for (int i = first_from[x]; i; i = next[i]) {
    int e = ed[i];
    if (!g[e].num) {
      g[e].p = id[i];
      g[e].pi = id[i];
      bridge (e);
      g[x].low = min (g[x].low, g[e].low);
    } else {
      if (g[x].p != id[i]) {
	g[x].low = min (g[x].low, g[e].num);
      }
    }
  }
  if (g[x].p && g[x].num == g[x].low) res[g[x].pi - 1] = 1;
}

int main ()
{
  int n, m;
  scanf ("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf ("%d %d %d", &edge[i].a, &edge[i].b, &edge[i].w);
    //    cin>>edge[i].a>>edge[i].b>>edge[i].w;
    edge[i].id = i;
  }
  for (int i = 0; i <= m; i++) p[i] = i;

  sort (edge, edge + m, comp);
  for (int i = 0; i < m; i++) {
    int j = i;
    while (edge[j].w == edge[i].w && j < m) j++;

    for (int k = i; k < j; k++) {
      int x = find_set(edge[k].a), y = find_set(edge[k].b);
      if (x == y) {
	res[edge[k].id] = 2;
	mark[k] = 1;
      }
    }

    for (int k = i; k < j; k++) if (!mark[k]){
	int x = find_set (edge[k].a), y = find_set (edge[k].b);
	first_from[x] = first_from[y] = 0;
      }
    for (int k = i; k < j; k++) if (!mark[k]){
	int x = find_set (edge[k].a), y = find_set (edge[k].b);
	add_edge (x, y, edge[k].id);
	add_edge (y, x, edge[k].id);
	g[x].num = g[y].num = g[x].p = g[y].p = 0;
      }
    visit = 0;
    for (int k = i; k < j; k++) if (!mark[k]){
	int x = find_set (edge[k].a), y = find_set (edge[k].b);
	if (!g[x].num) bridge(x);
	if (!g[y].num) bridge(y);
      }
    for (int k = i; k < j; k++) if (!mark[k]){
	int x = find_set (edge[k].a), y = find_set (edge[k].b);
	if (x != y) link (x, y);
      }
    i = j - 1;
  }
  for (int i = 0; i < m; i++) {
    if (res[i] == 2)
      printf ("none\n");
    else if (res[i] == 1)
      printf ("any\n");
    else
      printf("at least one\n");
  }

  return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
using namespace std;
const int MAXN=100005;
char res[][20]={"none","at least one","any"};
struct Edge
{
    int x,y,val,id,ans;
    bool operator <(const Edge &a)const
    {
        return val<a.val;
    }
}e[MAXN];
int n,m;
int fa[MAXN];
map<int, vector<int> > v,mark;
set<int> Set;
int vis[MAXN],first[MAXN];
int tim;
int find(int x)
{
    return fa[x]==x?x:fa[x]=find(fa[x]);
}
bool cmp(Edge a,Edge b)
{
    return a.id<b.id;
}
void tarjan(int x)
{
    if(vis[x])return ;
    vis[x]=first[x]=++tim;
    int i;
    for(i=0;i<v[x].size();i++)
    {
        int y=v[x][i];
        int Mark=mark[x][i];
        if(Set.count(Mark))
            continue;
        Set.insert(Mark);
        tarjan(y);
        if(vis[y]<vis[x])
            vis[x]=vis[y];
        if(vis[y]>first[x])
            e[Mark].ans=2;
    }
}
int main()
{
    int i,j;
    scanf("%d%d",&n,&m);
    for(i=0;i<=n;i++)
        fa[i]=i;
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&e[i].x,&e[i].y,&e[i].val);
        e[i].id=i;
        e[i].ans=0;
    }
    sort(e,e+m);
    for(i=0;i<m;)
    {
        int s=i,x,y;
        while(i<m&&e[i].val==e[s].val)
            i++;
        tim=0;
        memset(vis,0,sizeof(vis));
        memset(first,0,sizeof(first));
        v.clear();
        Set.clear();
        for(j=s;j<i;j++)
        {
            x=find(e[j].x);
            y=find(e[j].y);
            if(x==y)
                continue;
            e[j].ans=1;
            v[x].push_back(y);
            v[y].push_back(x);
            mark[x].push_back(j);
            mark[y].push_back(j);
        }
        for(map<int,vector<int> >::iterator it=v.begin();it!=v.end();it++)
        {
            tarjan(it->first);
        }
        for(j=s;j<i;j++)
        {
            x=find(e[j].x);
            y=find(e[j].y);
            if(x==y)
                continue;
            fa[x]=y;
        }
    }
    sort(e,e+m,cmp);
    for(i=0;i<m;i++)
        printf("%s\n",res[e[i].ans]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
const int MAXN=100005;
int n,m;
struct Edge
{
    int x,y,val,id,ans;
    bool operator < (const Edge& a) const
    {
        return val<a.val;
    }
}e[MAXN];
struct E
{
    int v,next,id;
}edge[MAXN*2];
int fa[MAXN];
int low[MAXN],dep[MAXN];
int head[MAXN],len;
int mark[MAXN];
char res[][20]={"none","any","at least one"};
void add_edge(int u,int v,int id)
{
    edge[len].v=v;
    edge[len].id=id;
    edge[len].next=head[u];
    head[u]=len++;
}
int find(int x)
{
    return fa[x]==x?x:fa[x]=find(fa[x]);
}
bool cmp(Edge a,Edge b)
{
    return a.id<b.id;
}
void dfs(int u,int father,int depth)
{
    int i;
    mark[u]=1;
    low[u]=dep[u]=depth;
    for(i=head[u];i!=-1;i=edge[i].next)
    {
        int v=edge[i].v;
        if(mark[v]==1&&edge[i].id!=father&&dep[v]<low[u])
            low[u]=dep[v];
        else if(mark[v]==0)
        {
            dfs(v,edge[i].id,depth+1);
            if(low[v]<low[u])
                low[u]=low[v];
            if(low[v]>dep[u])
                e[edge[i].id].ans=1;
        }
    }
    mark[u]=2;
}
int main()
{
    int i,j;
    scanf("%d%d",&n,&m);
    for(i=0;i<=n;i++)
        fa[i]=i;
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&e[i].x,&e[i].y,&e[i].val);
        e[i].id=i;
        e[i].ans=0;
    }
    sort(e,e+m);
    for(i=0;i<m;)
    {
        int s=i;
        while(i<m&&e[i].val==e[s].val)
            i++;
        memset(head,-1,sizeof(head));
        memset(mark,0,sizeof(mark));
        len=0;
        for(j=s;j<i;j++)
        {
            int x=find(e[j].x);
            int y=find(e[j].y);
            if(x==y)
                continue;
            e[j].ans=2;
            add_edge(x,y,j);
            add_edge(y,x,j);
        }
        for(j=1;j<=n;j++)
        {
            if(head[j]!=-1&&!mark[j])
                dfs(j,0,1);
        }
        for(j=s;j<i;j++)
        {
            int x=find(e[j].x);
            int y=find(e[j].y);
            if(x==y)
                continue;
            fa[x]=y;
        }
    }
    sort(e,e+m,cmp);
    for(i=0;i<m;i++)
        printf("%s\n",res[e[i].ans]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
const int MAXN=100005;
int n,m;
struct Edge
{
    int x,y,val,id,ans;
    bool operator < (const Edge& a) const
    {
        return val<a.val;
    }
}e[MAXN];
struct E
{
    int v,next,id;
}edge[MAXN*2];
int fa[MAXN];
int low[MAXN],dep[MAXN];
int head[MAXN],len;
int mark[MAXN];
int com[MAXN];
char res[][20]={"none","any","at least one"};
void add_edge(int u,int v,int id)
{
    edge[len].v=v;
    edge[len].id=id;
    edge[len].next=head[u];
    head[u]=len++;
}
int find(int x)
{
    return fa[x]==x?x:fa[x]=find(fa[x]);
}
bool cmp(Edge a,Edge b)
{
    return a.id<b.id;
}
void dfs(int u,int father,int depth)
{
    int i;
    mark[u]=1;
    low[u]=dep[u]=depth;
    for(i=head[u];i!=-1;i=edge[i].next)
    {
        int v=edge[i].v;
        if(mark[v]==1&&edge[i].id!=father&&dep[v]<low[u])
            low[u]=dep[v];
        else if(mark[v]==0)
        {
            dfs(v,edge[i].id,depth+1);
            if(low[v]<low[u])
                low[u]=low[v];
            if(low[v]>dep[u])
                e[edge[i].id].ans=1;
        }
    }
    mark[u]=2;
}
int main()
{
    int i,j,x,y;
    scanf("%d%d",&n,&m);
    for(i=0;i<=n;i++)
        fa[i]=i;
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&e[i].x,&e[i].y,&e[i].val);
        e[i].id=i;
        e[i].ans=0;
    }
    sort(e,e+m);
    memset(head,-1,sizeof(head));
    len=0;
    for(i=0;i<m;)
    {
        int s=i;
        while(i<m&&e[i].val==e[s].val)
            i++;
        for(j=s;j<i;j++)
        {
            x=find(e[j].x);
            y=find(e[j].y);
            if(x==y)
                continue;
            e[j].ans=2;
            add_edge(x,y,j);
            add_edge(y,x,j);
            com[j]=x;
        }
        for(j=s;j<i;j++)
        {
            if(com[j]&&!mark[com[j]])
                dfs(com[j],0,1);
        }
        for(j=s;j<i;j++)
        {
            x=find(e[j].x);
            y=find(e[j].y);
            head[x]=-1;
            head[y]=-1;
            mark[x]=0;
            mark[y]=0;
            if(x==y)
                continue;
            fa[x]=y;
        }
        len=0;
    }
    sort(e,e+m,cmp);
    for(i=0;i<m;i++)
        printf("%s\n",res[e[i].ans]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
const int MAXN=100005;
int n,m;
struct Edge
{
    int x,y,val,id,ans;
    bool operator < (const Edge& a) const
    {
        return val<a.val;
    }
}e[MAXN];
struct E
{
    int v,next,id;
}edge[MAXN*2];
int fa[MAXN];
int low[MAXN],dep[MAXN];
int head[MAXN],len;
int mark[MAXN];
int com[MAXN];
char res[][20]={"none","any","at least one"};
void add_edge(int u,int v,int id)
{
    edge[len].v=v;
    edge[len].id=id;
    edge[len].next=head[u];
    head[u]=len++;
}
int find(int x)
{
    return fa[x]==x?x:fa[x]=find(fa[x]);
}
bool cmp(Edge a,Edge b)
{
    return a.id<b.id;
}
void dfs(int u,int father,int depth)
{
    int i;
    mark[u]=1;
    low[u]=dep[u]=depth;
    for(i=head[u];i!=-1;i=edge[i].next)
    {
        int v=edge[i].v;
        if(mark[v]==1&&edge[i].id!=father&&dep[v]<low[u])
            low[u]=dep[v];
        else if(mark[v]==0)
        {
            dfs(v,edge[i].id,depth+1);
            if(low[v]<low[u])
                low[u]=low[v];
            if(low[v]>dep[u])
                e[edge[i].id].ans=1;
        }
    }
    mark[u]=2;
}
int main()
{
    int i,j,x,y;
    scanf("%d%d",&n,&m);
    for(i=0;i<=n;i++)
        fa[i]=i;
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&e[i].x,&e[i].y,&e[i].val);
        e[i].id=i;
        e[i].ans=0;
    }
    sort(e,e+m);
    for(i=0;i<m;)
    {
        int s=i;
        while(i<m&&e[i].val==e[s].val)
            i++;
        memset(head,-1,sizeof(head));
        memset(mark,0,sizeof(mark));
        len=0;
        for(j=s;j<i;j++)
        {
            x=find(e[j].x);
            y=find(e[j].y);
            if(x==y)
                continue;
            e[j].ans=2;
            add_edge(x,y,j);
            add_edge(y,x,j);
            com[j]=x;
        }
        for(j=s;j<i;j++)
        {
            if(com[j]&&!mark[com[j]])
                dfs(com[j],0,1);
        }
        for(j=s;j<i;j++)
        {
            x=find(e[j].x);
            y=find(e[j].y);
            if(x==y)
                continue;
            fa[x]=y;
        }
    }
    sort(e,e+m,cmp);
    for(i=0;i<m;i++)
        printf("%s\n",res[e[i].ans]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
const int MAXN=100005;
int n,m;
struct Edge
{
    int x,y,val,id,ans;
    bool operator < (const Edge& a) const
    {
        return val<a.val;
    }
}e[MAXN];
struct E
{
    int v,next,id;
}edge[MAXN*2];
int fa[MAXN];
int low[MAXN],dep[MAXN];
int head[MAXN],len;
int mark[MAXN];
int q[MAXN],top;
char res[][20]={"none","any","at least one"};
void add_edge(int u,int v,int id)
{
    edge[len].v=v;
    edge[len].id=id;
    edge[len].next=head[u];
    head[u]=len++;
}
int find(int x)
{
    return fa[x]==x?x:fa[x]=find(fa[x]);
}
bool cmp(Edge a,Edge b)
{
    return a.id<b.id;
}
void dfs(int u,int father,int depth)
{
    int i;
    mark[u]=1;
    low[u]=dep[u]=depth;
    for(i=head[u];i!=-1;i=edge[i].next)
    {
        int v=edge[i].v;
        if(mark[v]==1&&edge[i].id!=father&&dep[v]<low[u])
            low[u]=dep[v];
        else if(mark[v]==0)
        {
            dfs(v,edge[i].id,depth+1);
            if(low[v]<low[u])
                low[u]=low[v];
            if(low[v]>dep[u])
                e[edge[i].id].ans=1;
        }
    }
    mark[u]=2;
}
int main()
{
    int i,j;
    scanf("%d%d",&n,&m);
    for(i=0;i<=n;i++)
        fa[i]=i;
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&e[i].x,&e[i].y,&e[i].val);
        e[i].id=i;
        e[i].ans=0;
    }
    sort(e,e+m);
    for(i=0;i<m;)
    {
        int s=i;
        while(i<m&&e[i].val==e[s].val)
            i++;
        memset(head,-1,sizeof(head));
        memset(mark,0,sizeof(mark));
        top=0;
        len=0;
        for(j=s;j<i;j++)
        {
            int x=find(e[j].x);
            int y=find(e[j].y);
            if(x==y)
                continue;
            e[j].ans=2;
            if(head[x]==-1)
                q[top++]=x;
            if(head[y]==-1)
                q[top++]=y;
            add_edge(x,y,j);
            add_edge(y,x,j);
        }
        for(j=0;j<top;j++)
        {
            if(!mark[q[j]])
                dfs(q[j],0,1);
        }
        for(j=s;j<i;j++)
        {
            int x=find(e[j].x);
            int y=find(e[j].y);
            if(x==y)
                continue;
            fa[x]=y;
        }
    }
    sort(e,e+m,cmp);
    for(i=0;i<m;i++)
        printf("%s\n",res[e[i].ans]);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define INF_LL 9223372036854775807LL
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
#define LL long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define setzero(a) memset(a,0,sizeof(a))
#define setdp(a) memset(a,-1,sizeof(a))

using namespace std;

struct edge
{
    int from, to, cost, index;

    edge(int x,int y,int z,int i)
    {
        from = x, to = y, cost = z, index = i;
    }

    bool operator < (const edge &e) const
    {
        return e.cost > cost;
    }
};

struct disjointset
{
    vector<int> rank, parent;
    int subtrees;

    disjointset(int n)
    {
        subtrees = n;
        for(int i=0;i<n;i++)
            rank.pb(1),parent.pb(i);
    }

    int find_set(int x)
    {
        if(x == parent[x])
            return x;
        return parent[x] = find_set(parent[x]);
    }

    void link(int x,int y)
    {
        if(rank[x] > rank[y])
            swap(x, y);
        parent[x] = y;
        if(rank[x] == rank[y])
            rank[y]++;
    }

    bool union_sets(int x,int y)
    {
        x = find_set(x),y = find_set(y);
        if(x != y)
        {
            link(x,y);
            subtrees--;
        }
        return x != y;
    }

    bool same_set(int x,int y)
    {
        return find_set(x) == find_set(y);
    }
};

vector<edge> edges;
int sol[100005];
vector<vector<pair<int, int> > > graph(100005);
map<pair<int,int>, int > tbd;
int visited[100005];
int counter[100005];

int dfs(int node,int depth,int parent)
{
    visited[node] = depth;
    int maxi = depth;
    for(int i=0;i<graph[node].size();i++)
    {
        int next = graph[node][i].first;
        int k = graph[node][i].second;
        if(!visited[next])
        {
            int temp = dfs(next, depth + 1, node);
            maxi = min(maxi, temp);
            if(temp > depth)
                sol[k] = 0;
        }
        else if(parent != next) maxi = min(maxi, visited[next]);
    }
    return maxi;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m, x, y, z;
    cin >> n >> m;
    disjointset dset(n + 1);
    for(int i=0;i<m;i++)
    {
        cin >> x >> y >> z;
        edges.push_back(edge(x, y, z, i));
    }
    sort(edges.begin(), edges.end());
    for(int i=0;i<m;i++)
    {
        int k = i;
        while(1)
        {
            edge temp = edges[k];
            if(dset.same_set(temp.from, temp.to))
                sol[temp.index] = 2;
            else
            {
                int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
                tbd[mp(x,y)]++;
                tbd[mp(y,x)]++;
                graph[x].clear();
                graph[y].clear();
                visited[x] = 0;
                visited[y] = 0;
            }
            if(k < m - 1 && edges[k + 1].cost == temp.cost)
                k++;
            else break;
        }
        int tmp = -1;
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            sol[temp.index] = 1;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            tmp = x;
            graph[x].pb(mp(y, temp.index));
            graph[y].pb(mp(x, temp.index));
        }
        if(tmp != -1) dfs(tmp, 1, tmp);
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            if(tbd[mp(x,y)] > 1)
                sol[temp.index] = 1;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            dset.union_sets(temp.from, temp.to);
        }
        i = k;
    }
    for(int i=0;i<m;i++)
    {
        if(sol[i] == 0) cout << "any";
        else if(sol[i] == 1) cout << "at least one";
        else cout << "none";
        cout << "\n";
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define INF_LL 9223372036854775807LL
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
#define LL long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define setzero(a) memset(a,0,sizeof(a))
#define setdp(a) memset(a,-1,sizeof(a))

using namespace std;

struct edge
{
    int from, to, cost, index;

    edge(int x,int y,int z,int i)
    {
        from = x, to = y, cost = z, index = i;
    }

    bool operator < (const edge &e) const
    {
        return e.cost > cost;
    }
};

struct disjointset
{
    vector<int> rank, parent;
    int subtrees;

    disjointset(int n)
    {
        subtrees = n;
        for(int i=0;i<n;i++)
            rank.pb(1),parent.pb(i);
    }

    int find_set(int x)
    {
        if(x == parent[x])
            return x;
        return parent[x] = find_set(parent[x]);
    }

    void link(int x,int y)
    {
        if(rank[x] > rank[y])
            swap(x, y);
        parent[x] = y;
        if(rank[x] == rank[y])
            rank[y]++;
    }

    bool union_sets(int x,int y)
    {
        x = find_set(x),y = find_set(y);
        if(x != y)
        {
            link(x,y);
            subtrees--;
        }
        return x != y;
    }

    bool same_set(int x,int y)
    {
        return find_set(x) == find_set(y);
    }
};

vector<edge> edges;
int sol[100005];
vector<vector<pair<int, int> > > graph(100005);
map<pair<int,int>, int > tbd;
int visited[100005];
int counter[100005];

int dfs(int node,int depth,int parent)
{
    visited[node] = depth;
    int maxi = depth;
    for(int i=0;i<graph[node].size();i++)
    {
        int next = graph[node][i].first;
        int k = graph[node][i].second;
        if(!visited[next])
        {
            int temp = dfs(next, depth + 1, node);
            maxi = min(maxi, temp);
            if(temp > depth)
                sol[k] = 0;
        }
        else if(parent != next) maxi = min(maxi, visited[next]);
    }
    return maxi;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m, x, y, z;
    cin >> n >> m;
    disjointset dset(n + 1);
    for(int i=0;i<m;i++)
    {
        cin >> x >> y >> z;
        edges.push_back(edge(x, y, z, i));
    }
    sort(edges.begin(), edges.end());
    for(int i=0;i<m;i++)
    {
        int k = i;
        tbd.clear();
        while(1)
        {
            edge temp = edges[k];
            if(dset.same_set(temp.from, temp.to))
                sol[temp.index] = 2;
            else
            {
                int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
                tbd[mp(x,y)]++;
                tbd[mp(y,x)]++;
                graph[x].clear();
                graph[y].clear();
                visited[x] = 0;
                visited[y] = 0;
            }
            if(k < m - 1 && edges[k + 1].cost == temp.cost)
                k++;
            else break;
        }
        int tmp = -1;
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            sol[temp.index] = 1;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            tmp = x;
            graph[x].pb(mp(y, temp.index));
            graph[y].pb(mp(x, temp.index));
        }
        if(tmp != -1) dfs(tmp, 1, tmp);
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            if(tbd[mp(x,y)] > 1)
                sol[temp.index] = 1;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            dset.union_sets(temp.from, temp.to);
        }
        i = k;
    }
    for(int i=0;i<m;i++)
    {
        if(sol[i] == 0) cout << "any";
        else if(sol[i] == 1) cout << "at least one";
        else cout << "none";
        cout << "\n";
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define INF_LL 9223372036854775807LL
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
#define LL long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define setzero(a) memset(a,0,sizeof(a))
#define setdp(a) memset(a,-1,sizeof(a))

using namespace std;

struct edge
{
    int from, to, cost, index;

    edge(int x,int y,int z,int i)
    {
        from = x, to = y, cost = z, index = i;
    }

    bool operator < (const edge &e) const
    {
        return e.cost > cost;
    }
};

struct disjointset
{
    vector<int> rank, parent;
    int subtrees;

    disjointset(int n)
    {
        subtrees = n;
        for(int i=0;i<n;i++)
            rank.pb(1),parent.pb(i);
    }

    int find_set(int x)
    {
        if(x == parent[x])
            return x;
        return parent[x] = find_set(parent[x]);
    }

    void link(int x,int y)
    {
        if(rank[x] > rank[y])
            swap(x, y);
        parent[x] = y;
        if(rank[x] == rank[y])
            rank[y]++;
    }

    bool union_sets(int x,int y)
    {
        x = find_set(x),y = find_set(y);
        if(x != y)
        {
            link(x,y);
            subtrees--;
        }
        return x != y;
    }

    bool same_set(int x,int y)
    {
        return find_set(x) == find_set(y);
    }
};

vector<edge> edges;
int sol[100005];
vector<vector<pair<int, int> > > graph(100005);
map<pair<int,int>, int > tbd;
int visited[100005];

int dfs(int node,int depth,int parent)
{
    visited[node] = depth;
    int maxi = depth;
    for(int i=0;i<graph[node].size();i++)
    {
        int next = graph[node][i].first;
        int k = graph[node][i].second;
        if(!visited[next])
        {
            int temp = dfs(next, depth + 1, node);
            maxi = min(maxi, temp);
            if(temp > depth)
                sol[k] = 0;
        }
        else if(parent != next) maxi = min(maxi, visited[next]);
    }
    return maxi;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m, x, y, z;
    cin >> n >> m;
    disjointset dset(n + 1);
    for(int i=0;i<m;i++)
    {
        cin >> x >> y >> z;
        edges.push_back(edge(x, y, z, i));
    }
    sort(edges.begin(), edges.end());
    for(int i=0;i<m;i++)
    {
        int k = i;
        tbd.clear();
        while(1)
        {
            edge temp = edges[k];
            if(dset.same_set(temp.from, temp.to))
                sol[temp.index] = 2;
            else
            {
                int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
                tbd[mp(x,y)]++;
                tbd[mp(y,x)]++;
                graph[x].clear();
                graph[y].clear();
                visited[x] = 0;
                visited[y] = 0;
            }
            if(k < m - 1 && edges[k + 1].cost == temp.cost)
                k++;
            else break;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            sol[temp.index] = 1;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            graph[x].pb(mp(y, temp.index));
            graph[y].pb(mp(x, temp.index));
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            int x = dset.find_set(temp.to);
            if(!visited[x])
                dfs(x, 1, x);
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            if(tbd[mp(x,y)] > 1)
                sol[temp.index] = 1;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            dset.union_sets(temp.from, temp.to);
        }
        i = k;
    }
    for(int i=0;i<m;i++)
    {
        if(sol[i] == 0) cout << "any";
        else if(sol[i] == 1) cout << "at least one";
        else cout << "none";
        cout << "\n";
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define INF_LL 9223372036854775807LL
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
#define LL long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define setzero(a) memset(a,0,sizeof(a))
#define setdp(a) memset(a,-1,sizeof(a))

using namespace std;

struct edge
{
    int from, to, cost, index;

    edge(int x,int y,int z,int i)
    {
        from = x, to = y, cost = z, index = i;
    }

    bool operator < (const edge &e) const
    {
        return e.cost > cost;
    }
};

struct disjointset
{
    vector<int> rank, parent;
    int subtrees;

    disjointset(int n)
    {
        subtrees = n;
        for(int i=0;i<n;i++)
            rank.pb(1),parent.pb(i);
    }

    int find_set(int x)
    {
        if(x == parent[x])
            return x;
        return parent[x] = find_set(parent[x]);
    }

    void link(int x,int y)
    {
        if(rank[x] > rank[y])
            swap(x, y);
        parent[x] = y;
        if(rank[x] == rank[y])
            rank[y]++;
    }

    bool union_sets(int x,int y)
    {
        x = find_set(x),y = find_set(y);
        if(x != y)
        {
            link(x,y);
            subtrees--;
        }
        return x != y;
    }

    bool same_set(int x,int y)
    {
        return find_set(x) == find_set(y);
    }
};

vector<edge> edges;
int sol[100005];
map<pair<int,int>, int > tbd;
map<int, bool> tvisited;
vector<vector<pair<int, int> > > graph(100005);
bool nvisited[100005];
int counter[100005];

bool dfs(int node, int parent, int cyc)
{
    tvisited[node] = 1;
    bool res = 0;
    for(int i=0;i<graph[node].size();i++)
    {
        int next = graph[node][i].first;
        int k = graph[node][i].second;
        if(next == cyc && parent != cyc)
        {
            sol[k] = 1;
            res = 1;
            continue;
        }
        if(nvisited[next] || tvisited[next]) continue;
        if(dfs(next, node, cyc))
        {
            sol[k] = 1;
            res = 1;
        }
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m, x, y, z;
    cin >> n >> m;
    disjointset dset(n + 1);
    for(int i=0;i<m;i++)
    {
        cin >> x >> y >> z;
        edges.push_back(edge(x, y, z, i));
    }
    sort(edges.begin(), edges.end());
    for(int i=0;i<m;i++)
    {
        tbd.clear();
        int k = i;
        while(1)
        {
            edge temp = edges[k];
            if(dset.same_set(temp.from, temp.to))
                sol[temp.index] = 2;
            else
            {
                tbd[mp(dset.find_set(temp.from), dset.find_set(temp.to))]++;
                tbd[mp(dset.find_set(temp.to), dset.find_set(temp.from))]++;
                graph[temp.to].clear();
                graph[temp.from].clear();
                nvisited[temp.from] = 0;
                nvisited[temp.to] = 0;
                counter[temp.from] = 0;
                counter[temp.to] = 0;
            }
            if(k < m - 1 && edges[k + 1].cost == temp.cost)
                k++;
            else break;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            if(tbd[mp(dset.find_set(temp.from), dset.find_set(temp.to))] > 1)
                sol[temp.index] = 1;
            else
            {
                graph[temp.from].pb(mp(temp.to, j));
                graph[temp.to].pb(mp(temp.from, j));
                counter[temp.from]++;
                counter[temp.to]++;
            }
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            dset.union_sets(temp.from, temp.to);
            if(sol[temp.index] == 2 || sol[temp.index] == 1) continue;
            if(!nvisited[temp.from] && counter[temp.from] > 1)
            {
                tvisited.clear();
                dfs(temp.from, temp.from, temp.from);
                nvisited[temp.from] = 1;
            }
            if(!nvisited[temp.to] && counter[temp.to] > 1)
            {
                tvisited.clear();
                dfs(temp.to, temp.to, temp.to);
                nvisited[temp.to] = 1;
            }
        }
        i = k;
    }
    for(int i=0;i<m;i++)
    {
        if(sol[i] == 0) cout << "any";
        else if(sol[i] == 1) cout << "at least one";
        else cout << "none";
        cout << "\n";
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define INF_LL 9223372036854775807LL
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
#define LL long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define setzero(a) memset(a,0,sizeof(a))
#define setdp(a) memset(a,-1,sizeof(a))

using namespace std;

struct edge
{
    int from, to, cost, index;

    edge(int x,int y,int z,int i)
    {
        from = x, to = y, cost = z, index = i;
    }

    bool operator < (const edge &e) const
    {
        return e.cost > cost;
    }
};

struct disjointset
{
    vector<int> rank, parent;
    int subtrees;

    disjointset(int n)
    {
        subtrees = n;
        for(int i=0;i<n;i++)
            rank.pb(1),parent.pb(i);
    }

    int find_set(int x)
    {
        if(x == parent[x])
            return x;
        return parent[x] = find_set(parent[x]);
    }

    void link(int x,int y)
    {
        if(rank[x] > rank[y])
            swap(x, y);
        parent[x] = y;
        if(rank[x] == rank[y])
            rank[y]++;
    }

    bool union_sets(int x,int y)
    {
        x = find_set(x),y = find_set(y);
        if(x != y)
        {
            link(x,y);
            subtrees--;
        }
        return x != y;
    }

    bool same_set(int x,int y)
    {
        return find_set(x) == find_set(y);
    }
};

vector<edge> edges;
int sol[100005];
vector<vector<pair<int, int> > > graph(100005);
map<pair<int,int>, int > tbd;
int visited[100005];
int counter[100005];

int dfs(int node,int depth,int parent)
{
    visited[node] = depth;
    int maxi = depth;
    for(int i=0;i<graph[node].size();i++)
    {
        int next = graph[node][i].first;
        int k = graph[node][i].second;
        if(!visited[next])
        {
            int temp = dfs(next, depth + 1, node);
            maxi = min(maxi, temp);
            if(temp > depth)
                sol[k] = 0;
        }
        else if(parent != next) maxi = min(maxi, visited[next]);
    }
    return maxi;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m, x, y, z;
    cin >> n >> m;
    disjointset dset(n + 1);
    for(int i=0;i<m;i++)
    {
        cin >> x >> y >> z;
        edges.push_back(edge(x, y, z, i));
    }
    sort(edges.begin(), edges.end());
    for(int i=0;i<m;i++)
    {
        int k = i;
        while(1)
        {
            tbd.clear();
            edge temp = edges[k];
            if(dset.same_set(temp.from, temp.to))
                sol[temp.index] = 2;
            else
            {
                int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
                tbd[mp(x,y)]++;
                tbd[mp(y,x)]++;
                graph[x].clear();
                graph[y].clear();
                visited[x] = 0;
                visited[y] = 0;
            }
            if(k < m - 1 && edges[k + 1].cost == temp.cost)
                k++;
            else break;
        }
        int tmp = -1;
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            sol[temp.index] = 1;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            tmp = x;
            graph[x].pb(mp(y, temp.index));
            graph[y].pb(mp(x, temp.index));
        }
        if(tmp != -1) dfs(tmp, 1, tmp);
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            if(tbd[mp(x,y)] > 1)
                sol[temp.index] = 1;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            dset.union_sets(temp.from, temp.to);
        }
        i = k;
    }
    for(int i=0;i<m;i++)
    {
        if(sol[i] == 0) cout << "any";
        else if(sol[i] == 1) cout << "at least one";
        else cout << "none";
        cout << "\n";
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define INF_LL 9223372036854775807LL
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
#define LL long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define setzero(a) memset(a,0,sizeof(a))
#define setdp(a) memset(a,-1,sizeof(a))

using namespace std;

struct edge
{
    int from, to, cost, index;

    edge(int x,int y,int z,int i)
    {
        from = x, to = y, cost = z, index = i;
    }

    bool operator < (const edge &e) const
    {
        return e.cost > cost;
    }
};

struct disjointset
{
    vector<int> rank, parent;
    int subtrees;

    disjointset(int n)
    {
        subtrees = n;
        for(int i=0;i<n;i++)
            rank.pb(1),parent.pb(i);
    }

    int find_set(int x)
    {
        if(x == parent[x])
            return x;
        return parent[x] = find_set(parent[x]);
    }

    void link(int x,int y)
    {
        if(rank[x] > rank[y])
            swap(x, y);
        parent[x] = y;
        if(rank[x] == rank[y])
            rank[y]++;
    }

    bool union_sets(int x,int y)
    {
        x = find_set(x),y = find_set(y);
        if(x != y)
        {
            link(x,y);
            subtrees--;
        }
        return x != y;
    }

    bool same_set(int x,int y)
    {
        return find_set(x) == find_set(y);
    }
};

vector<edge> edges;
int sol[100005];
vector<vector<pair<int, int> > > graph(100005);
map<pair<int,int>, int > tbd;
int visited[100005];

int dfs(int node,int depth,int parent)
{
    visited[node] = depth;
    int maxi = depth;
    for(int i=0;i<graph[node].size();i++)
    {
        int next = graph[node][i].first;
        int k = graph[node][i].second;
        if(!visited[next])
        {
            int temp = dfs(next, depth + 1, node);
            maxi = min(maxi, temp);
            if(temp > depth)
                sol[k] = 0;
        }
        else if(parent != next) maxi = min(maxi, visited[next]);
    }
    return maxi;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m, x, y, z;
    cin >> n >> m;
    disjointset dset(n + 1);
    for(int i=0;i<m;i++)
    {
        cin >> x >> y >> z;
        edges.push_back(edge(x, y, z, i));
    }
    sort(edges.begin(), edges.end());
    for(int i=0;i<m;i++)
    {
        int k = i;
        tbd.clear();
        while(1)
        {
            edge temp = edges[k];
            if(dset.same_set(temp.from, temp.to))
                sol[temp.index] = 2;
            else
            {
                int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
                tbd[mp(x,y)]++;
                tbd[mp(y,x)]++;
                graph[x].clear();
                graph[y].clear();
                visited[x] = 0;
                visited[y] = 0;
            }
            if(k < m - 1 && edges[k + 1].cost == temp.cost)
                k++;
            else break;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            sol[temp.index] = 1;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            graph[x].pb(mp(y, temp.index));
            graph[y].pb(mp(x, temp.index));
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            if(!visited[temp.from])
                dfs(temp.from, 1, temp.from);
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            int x = dset.find_set(temp.to), y = dset.find_set(temp.from);
            if(tbd[mp(x,y)] > 1)
                sol[temp.index] = 1;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            dset.union_sets(temp.from, temp.to);
        }
        i = k;
    }
    for(int i=0;i<m;i++)
    {
        if(sol[i] == 0) cout << "any";
        else if(sol[i] == 1) cout << "at least one";
        else cout << "none";
        cout << "\n";
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define INF_LL 9223372036854775807LL
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
#define LL long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define setzero(a) memset(a,0,sizeof(a))
#define setdp(a) memset(a,-1,sizeof(a))

using namespace std;

struct edge
{
    int from, to, cost, index;

    edge(int x,int y,int z,int i)
    {
        from = x, to = y, cost = z, index = i;
    }

    bool operator < (const edge &e) const
    {
        return e.cost > cost;
    }
};

struct disjointset
{
    vector<int> rank, parent;
    int subtrees;

    disjointset(int n)
    {
        subtrees = n;
        for(int i=0;i<n;i++)
            rank.pb(1),parent.pb(i);
    }

    int find_set(int x)
    {
        if(x == parent[x])
            return x;
        return parent[x] = find_set(parent[x]);
    }

    void link(int x,int y)
    {
        if(rank[x] > rank[y])
            swap(x, y);
        parent[x] = y;
        if(rank[x] == rank[y])
            rank[y]++;
    }

    bool union_sets(int x,int y)
    {
        x = find_set(x),y = find_set(y);
        if(x != y)
        {
            link(x,y);
            subtrees--;
        }
        return x != y;
    }

    bool same_set(int x,int y)
    {
        return find_set(x) == find_set(y);
    }
};

vector<edge> edges;
int sol[100005];
map<pair<int,int>, int > tbd;
vector<vector<pair<int, int> > > graph(100005);
bool nvisited[100005], tvisited[100005];
int counter[100005];

bool dfs(int node, int parent, int cyc)
{
    tvisited[node] = 1;
    bool res = 0;
    for(int i=0;i<graph[node].size();i++)
    {
        int next = graph[node][i].first;
        int k = graph[node][i].second;
        if(next == cyc && parent != cyc)
        {
            sol[k] = max(sol[k], 1);
            res = 1;
            continue;
        }
        if(nvisited[next] || tvisited[next]) continue;
        if(dfs(next, node, cyc))
        {
            sol[k] = max(sol[k], 1);
            res = 1;
        }
    }
    tvisited[node] = 0;
    return res;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m, x, y, z;
    cin >> n >> m;
    disjointset dset(n + 1);
    for(int i=0;i<m;i++)
    {
        cin >> x >> y >> z;
        edges.push_back(edge(x, y, z, i));
    }
    sort(edges.begin(), edges.end());
    for(int i=0;i<m;i++)
    {
        tbd.clear();
        int k = i;
        while(1)
        {
            edge temp = edges[k];
            if(dset.same_set(temp.from, temp.to))
                sol[temp.index] = 2;
            else
            {
                tbd[mp(dset.find_set(temp.from), dset.find_set(temp.to))]++;
                tbd[mp(dset.find_set(temp.to), dset.find_set(temp.from))]++;
                graph[temp.to].clear();
                graph[temp.from].clear();
                nvisited[temp.from] = 0;
                nvisited[temp.to] = 0;
                counter[temp.from] = 0;
                counter[temp.to] = 0;
            }
            if(k < m - 1 && edges[k + 1].cost == temp.cost)
                k++;
            else break;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            graph[temp.from].pb(mp(temp.to, j));
            graph[temp.to].pb(mp(temp.from, j));
            counter[temp.from]++;
            counter[temp.to]++;
            if(sol[temp.index] == 2) continue;
            if(tbd[mp(dset.find_set(temp.from), dset.find_set(temp.to))] > 1)
                sol[temp.index] = 1;
        }
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            dset.union_sets(temp.from, temp.to);
            if(sol[temp.index] == 2 || sol[temp.index] == 1) continue;
            if(!nvisited[temp.from] && counter[temp.from] > 1)
            {
                dfs(temp.from, temp.from, temp.from);
                nvisited[temp.from] = 1;
            }
            if(!nvisited[temp.to] && counter[temp.to] > 1)
            {
                dfs(temp.to, temp.to, temp.to);
                nvisited[temp.to] = 1;
            }
        }
        i = k;
    }
    for(int i=0;i<m;i++)
    {
        if(sol[i] == 0) cout << "any";
        else if(sol[i] == 1) cout << "at least one";
        else cout << "none";
        cout << "\n";
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <limits>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define INF_LL 9223372036854775807LL
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
#define LL long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define setzero(a) memset(a,0,sizeof(a))
#define setdp(a) memset(a,-1,sizeof(a))

using namespace std;

struct edge
{
    int from, to, cost, index;

    edge(int x,int y,int z,int i)
    {
        from = x, to = y, cost = z, index = i;
    }

    bool operator < (const edge &e) const
    {
        return e.cost > cost;
    }
};

struct disjointset
{
    vector<int> rank, parent;
    int subtrees;

    disjointset(int n)
    {
        subtrees = n;
        for(int i=0;i<n;i++)
            rank.pb(1),parent.pb(i);
    }

    int find_set(int x)
    {
        if(x == parent[x])
            return x;
        return parent[x] = find_set(parent[x]);
    }

    void link(int x,int y)
    {
        if(rank[x] > rank[y])
            swap(x, y);
        parent[x] = y;
        if(rank[x] == rank[y])
            rank[y]++;
    }

    bool union_sets(int x,int y)
    {
        x = find_set(x),y = find_set(y);
        if(x != y)
        {
            link(x,y);
            subtrees--;
        }
        return x != y;
    }

    bool same_set(int x,int y)
    {
        return find_set(x) == find_set(y);
    }
};

vector<edge> edges;
int sol[100005];

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m, x, y, z;
    cin >> n >> m;
    disjointset dset(n + 1);
    for(int i=0;i<m;i++)
    {
        cin >> x >> y >> z;
        edges.push_back(edge(x, y, z, i));
    }
    sort(edges.begin(), edges.end());
    for(int i=0;i<m;i++)
    {
        int k = i;
        while(1)
        {
            edge temp = edges[k];
            if(dset.same_set(temp.from, temp.to))
                sol[temp.index] = 2;
            if(k < m - 1 && edges[k + 1].cost == temp.cost)
                k++;
            else break;
        }
        vector<int> tbd;
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            if(!dset.union_sets(temp.from, temp.to))
                tbd.push_back(dset.find_set(temp.from));
        }
        sort(tbd.begin(), tbd.end());
        for(int j=i;j<=k;j++)
        {
            edge temp = edges[j];
            if(sol[temp.index] == 2) continue;
            if(binary_search(tbd.begin(), tbd.end(), dset.find_set(temp.from)))
                sol[temp.index] = 1;
        }
        i = k;
    }
    for(int i=0;i<m;i++)
    {
        if(sol[i] == 0) cout << "any";
        else if(sol[i] == 1) cout << "at least one";
        else cout << "none";
        cout << "\n";
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = 100005;

struct edge_t {
    int x, y, z, id;
} edge[maxn];
int nbs[maxn], ev[maxn*2], next[maxn*2], ans[maxn], father[maxn], dfn[maxn], low[maxn], to[maxn], num[maxn*2], use[maxn], n, m, k, it;

void init() {
    scanf( "%d%d", &n, &m );
    for ( int i = 0; i < m; i++ ) scanf( "%d%d%d", &edge[i].x, &edge[i].y, &edge[i].z );
    for ( int i = 0; i < m; i++ ) edge[i].id = i;
}

int getfa( int x ) {
    if ( father[x] != x ) father[x] = getfa( father[x] );
    return father[x];
}

void dfs( int x ) {
    dfn[x] = low[x] = ++it;
    for ( int i = nbs[x]; i; i = next[i] ) {
        if ( use[i] ) continue;
        use[i+(i&1?1:-1)] = 1;
        if ( !dfn[ev[i]] ) {
            to[ev[i]] = i;
            dfs( ev[i] );
            low[x] = min( low[x], low[ev[i]] );
        } else low[x] = min( low[x], dfn[ev[i]] );
        if ( dfn[x] < low[ev[i]] ) ans[edge[num[i]].id] = 2;
    }
}

bool cmp( edge_t a, edge_t b ) {
    return a.z < b.z;
}

void addedge( int x, int y, int z ) {
    next[++k] = nbs[x];
    ev[k] = y;
    nbs[x] = k;
    num[k] = z;
    use[k] = 0;
}

void work() {
    memset( ans, -1, sizeof(ans) );
    sort( edge, edge+m, cmp );
    for ( int i = 1; i <= n; i++ ) father[i] = i;
    int i = 0;
    while ( i < m ) {
        int j = i;
        while ( j < m && edge[j].z == edge[i].z ) j++;
        for ( int h = i; h < j; h++ ) {
            if ( getfa(edge[h].x) == getfa(edge[h].y) ) ans[edge[i].id] = 0;
            else {
                int x = getfa(edge[h].x), y = getfa(edge[h].y);
                dfn[x] = dfn[y] = low[x] = low[y] = nbs[x] = nbs[y] = 0;
            }
        }
        k = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            ans[edge[h].id] = 1;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            to[x] = to[y] = -1;
            addedge( x, y, h );
            addedge( y, x, h );
        }
        it = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            if ( !dfn[x] ) dfs(x);
            if ( !dfn[y] ) dfs(y);
        }
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] != 0 ) father[getfa(edge[h].y)] = getfa(edge[h].x);
        }
        i = j;
    }
    for ( int i = 0; i < m; i++ ) {
        if ( ans[i] == 0 ) printf( "none\n" );
        else if ( ans[i] == 1 ) printf( "at least one\n" );
        else printf( "any\n" );
    }
}

int main() {
    init();
    work();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = 100005;

struct edge_t {
    int x, y, z, id;
} edge[maxn];
int nbs[maxn], ev[maxn*2], next[maxn*2], ans[maxn], father[maxn], dfn[maxn], low[maxn], num[maxn*2], use[maxn*2], col[maxn], n, m, k, it;

void init() {
    scanf( "%d%d", &n, &m );
    for ( int i = 0; i < m; i++ ) scanf( "%d%d%d", &edge[i].x, &edge[i].y, &edge[i].z );
    for ( int i = 0; i < m; i++ ) edge[i].id = i;
}

int getfa( int x ) {
    if ( father[x] != x ) father[x] = getfa( father[x] );
    return father[x];
}

void dfs( int x ) {
    dfn[x] = low[x] = ++it;
    for ( int i = nbs[x]; i; i = next[i] ) {
        if ( use[i] ) continue;
        use[i+(i&1?1:-1)] = 1;
        if ( !dfn[ev[i]] ) {
            dfs( ev[i] );
            low[x] = min( low[x], low[ev[i]] );
        } else low[x] = min( low[x], dfn[ev[i]] );
        if ( dfn[x] < low[ev[i]] ) ans[edge[num[i]].id] = 2;
    }
}

bool cmp( edge_t a, edge_t b ) {
    return a.z < b.z;
}

void addedge( int x, int y, int z ) {
    next[++k] = nbs[x];
    ev[k] = y;
    nbs[x] = k;
    num[k] = z;
    use[k] = 0;
}

void work() {
    memset( ans, -1, sizeof(ans) );
    sort( edge, edge+m, cmp );
    for ( int i = 1; i <= n; i++ ) father[i] = i;
    int i = 0;
    while ( i < m ) {
        int j = i;
        while ( j < m && edge[j].z == edge[i].z ) j++;
        for ( int h = i; h < j; h++ ) {
            if ( getfa(edge[h].x) == getfa(edge[h].y) ) ans[edge[h].id] = 0;
            else {
                int x = getfa(edge[h].x), y = getfa(edge[h].y);
                dfn[x] = dfn[y] = low[x] = low[y] = nbs[x] = nbs[y] = col[x] = col[y] = 0;
            }
        }
        k = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            ans[edge[h].id] = 1;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            addedge( x, y, h );
            addedge( y, x, h );
        }
        it = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            if ( !dfn[x] ) dfs(x);
            if ( !dfn[y] ) dfs(y);
        }
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] != 0 ) father[getfa(edge[h].y)] = getfa(edge[h].x);
        }
        i = j;
    }
    for ( int i = 0; i < m; i++ ) {
        if ( ans[i] == 0 ) printf( "none\n" );
        else if ( ans[i] == 1 ) printf( "at least one\n" );
        else printf( "any\n" );
    }
}

int main() {
    init();
    work();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <map>
#include <algorithm>

using namespace std;

const int maxn = 100005;

struct node {
    int id , l , r , t;
} bus[maxn] , psn[maxn];
int sgt[maxn*2] , ans[maxn] , n , m , k;
map<int,int> num;

void init() {
    scanf( "%d%d" , &n , &m );
    for ( int i = 1; i <= n; i++ ) scanf( "%d%d%d" , &bus[i].l , &bus[i].r , &bus[i].t );
    for ( int i = 1; i <= m; i++ ) scanf( "%d%d%d" , &psn[i].l , &psn[i].r , &psn[i].t );
    for ( int i = 1; i <= n; i++ ) bus[i].id = i;
    for ( int i = 1; i <= m; i++ ) psn[i].id = i;
}

void insert( int flag , int lower , int upper , int pos , int key ) {
    if ( lower == upper ) {
        if ( bus[sgt[flag]].r < bus[key].r ) sgt[flag] = key;
        return;
    }
    int mid = ( lower + upper ) >> 1;
    if ( pos <= mid ) insert( flag*2 , lower , mid , pos , key );
    else insert( flag*2+1 , mid+1 , upper , pos , key );
    if ( bus[sgt[flag*2]].r > bus[sgt[flag*2+1]].r ) sgt[flag] = sgt[flag*2];
    else sgt[flag] = sgt[flag*2+1];
}

int query( int flag , int lower , int upper , int st , int ed ) {
    if ( lower > upper ) return 0;
    if ( lower == st && upper == ed ) return sgt[flag];
    int mid = ( lower + upper ) >> 1;
    if ( ed <= mid ) return query( flag*2 , lower , mid , st , ed );
    else if ( st > mid ) return query( flag*2+1 , mid+1 , upper , st , ed );
    else {
        int t1 = query( flag*2 , lower , mid , st , mid ) , t2 = query( flag*2+1 , mid+1 , upper , mid+1 , ed );
        if ( bus[t1].r > bus[t2].r ) return t1;
        else return t2;
    }
}

bool cmp( node a , node b ) {
    return a.l < b.l;
}

void prepare() {
    sort( bus+1 , bus+n+1 , cmp );
    sort( psn+1 , psn+m+1 , cmp );
    for ( int i = 1; i <= n; i++ ) num[bus[i].t] = 1;
    for ( int i = 1; i <= m; i++ ) num[psn[i].t] = 1;
    for ( map<int,int>::iterator it = num.begin(); it != num.end(); it++ ) it->second = ++k;
}

void work() {
    prepare();
    int j = 1;
    for ( int i = 1; i <= m; i++ ) {
        while ( j <= n && bus[j].l <= psn[i].l ) {
            insert( 1 , 1 , k , num[bus[j].t] , j );
            j++;
        }
        int t = query( 1 , 1 , k , num[psn[i].t] , k );
        if ( !t || bus[t].r < psn[i].r ) ans[psn[i].id] = -1;
        else {
            int lower = num[psn[i].t] , upper = k;
            while ( lower < upper ) {
                int mid = ( lower + upper ) >> 1;
                t = query( 1 , 1 , k , lower , mid );
                if ( !t || bus[t].r < psn[i].r ) lower = mid + 1;
                else upper = mid;
            }
            t = query( 1 , 1 , k , lower , upper );
            ans[psn[i].id] = bus[t].id;
        }
    }
    for ( int i = 1; i < m; i++ ) printf( "%d " , ans[i] );
    printf( "%d\n" , ans[m] );
}

int main() {
    init();
    work();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = 100005;

struct edge_t {
    int x, y, z, id;
} edge[maxn];
int nbs[maxn], ev[maxn*2], next[maxn*2], ans[maxn], father[maxn], dfn[maxn], low[maxn], to[maxn], num[maxn*2], use[maxn], col[maxn], n, m, k, it;

void init() {
    scanf( "%d%d", &n, &m );
    for ( int i = 0; i < m; i++ ) scanf( "%d%d%d", &edge[i].x, &edge[i].y, &edge[i].z );
    for ( int i = 0; i < m; i++ ) edge[i].id = i;
}

int getfa( int x ) {
    if ( father[x] != x ) father[x] = getfa( father[x] );
    return father[x];
}

void dfs( int x ) {
    dfn[x] = low[x] = ++it;
    col[x] = 1;
    for ( int i = nbs[x]; i; i = next[i] ) {
        if ( use[i] ) continue;
        use[i+(i&1?1:-1)] = 1;
        if ( !dfn[ev[i]] ) {
            to[ev[i]] = i;
            dfs( ev[i] );
            low[x] = min( low[x], low[ev[i]] );
        } else if ( col[x] == 1 ) low[x] = min( low[x], dfn[ev[i]] );
        if ( dfn[x] < low[ev[i]] ) ans[edge[num[i]].id] = 2;
    }
    col[x] = 2;
}

bool cmp( edge_t a, edge_t b ) {
    return a.z < b.z;
}

void addedge( int x, int y, int z ) {
    next[++k] = nbs[x];
    ev[k] = y;
    nbs[x] = k;
    num[k] = z;
    use[k] = 0;
}

void work() {
    memset( ans, -1, sizeof(ans) );
    sort( edge, edge+m, cmp );
    for ( int i = 1; i <= n; i++ ) father[i] = i;
    int i = 0;
    while ( i < m ) {
        int j = i;
        while ( j < m && edge[j].z == edge[i].z ) j++;
        for ( int h = i; h < j; h++ ) {
            if ( getfa(edge[h].x) == getfa(edge[h].y) ) ans[edge[h].id] = 0;
            else {
                int x = getfa(edge[h].x), y = getfa(edge[h].y);
                dfn[x] = dfn[y] = low[x] = low[y] = nbs[x] = nbs[y] = col[x] = col[y] = 0;
            }
        }
        k = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            ans[edge[h].id] = 1;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            to[x] = to[y] = -1;
            addedge( x, y, h );
            addedge( y, x, h );
        }
        it = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            if ( !dfn[x] ) dfs(x);
            if ( !dfn[y] ) dfs(y);
        }
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] != 0 ) father[getfa(edge[h].y)] = getfa(edge[h].x);
        }
        i = j;
    }
    for ( int i = 0; i < m; i++ ) {
        if ( ans[i] == 0 ) printf( "none\n" );
        else if ( ans[i] == 1 ) printf( "at least one\n" );
        else printf( "any\n" );
    }
}

int main() {
    init();
    work();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = 100005;

struct edge_t {
    int x, y, z, id;
} edge[maxn];
int nbs[maxn], ev[maxn*2], next[maxn*2], ans[maxn], father[maxn], dfn[maxn], low[maxn], to[maxn], num[maxn*2], use[maxn], col[maxn], n, m, k, it;

void init() {
    scanf( "%d%d", &n, &m );
    for ( int i = 0; i < m; i++ ) scanf( "%d%d%d", &edge[i].x, &edge[i].y, &edge[i].z );
    for ( int i = 0; i < m; i++ ) edge[i].id = i;
}

int getfa( int x ) {
    if ( father[x] != x ) father[x] = getfa( father[x] );
    return father[x];
}

void dfs( int x ) {
    dfn[x] = low[x] = ++it;
    col[x] = 1;
    for ( int i = nbs[x]; i; i = next[i] ) {
        if ( use[i] ) continue;
        use[i+(i&1?1:-1)] = 1;
        if ( !dfn[ev[i]] ) {
            to[ev[i]] = i;
            dfs( ev[i] );
            low[x] = min( low[x], low[ev[i]] );
            if ( dfn[x] < low[ev[i]] ) ans[edge[num[i]].id] = 2;
        } else if ( col[x] == 1 ) low[x] = min( low[x], dfn[ev[i]] );
    }
    col[x] = 2;
}

bool cmp( edge_t a, edge_t b ) {
    return a.z < b.z;
}

void addedge( int x, int y, int z ) {
    next[++k] = nbs[x];
    ev[k] = y;
    nbs[x] = k;
    num[k] = z;
    use[k] = 0;
}

void work() {
    memset( ans, -1, sizeof(ans) );
    sort( edge, edge+m, cmp );
    for ( int i = 1; i <= n; i++ ) father[i] = i;
    int i = 0;
    while ( i < m ) {
        int j = i;
        while ( j < m && edge[j].z == edge[i].z ) j++;
        for ( int h = i; h < j; h++ ) {
            if ( getfa(edge[h].x) == getfa(edge[h].y) ) ans[edge[h].id] = 0;
            else {
                int x = getfa(edge[h].x), y = getfa(edge[h].y);
                dfn[x] = dfn[y] = low[x] = low[y] = nbs[x] = nbs[y] = col[x] = col[y] = 0;
            }
        }
        k = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            ans[edge[h].id] = 1;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            to[x] = to[y] = -1;
            addedge( x, y, h );
            addedge( y, x, h );
        }
        it = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            if ( !dfn[x] ) dfs(x);
            if ( !dfn[y] ) dfs(y);
        }
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] != 0 ) father[getfa(edge[h].y)] = getfa(edge[h].x);
        }
        i = j;
    }
    for ( int i = 0; i < m; i++ ) {
        if ( ans[i] == 0 ) printf( "none\n" );
        else if ( ans[i] == 1 ) printf( "at least one\n" );
        else printf( "any\n" );
    }
}

int main() {
    init();
    work();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = 100005;

struct edge_t {
    int x, y, z, id;
} edge[maxn];
int nbs[maxn], ev[maxn*2], next[maxn*2], ans[maxn], father[maxn], dfn[maxn], low[maxn], num[maxn*2], use[maxn*2], col[maxn], n, m, k, it;

void init() {
    scanf( "%d%d", &n, &m );
    for ( int i = 0; i < m; i++ ) scanf( "%d%d%d", &edge[i].x, &edge[i].y, &edge[i].z );
    for ( int i = 0; i < m; i++ ) edge[i].id = i;
}

int getfa( int x ) {
    if ( father[x] != x ) father[x] = getfa( father[x] );
    return father[x];
}

void dfs( int x ) {
    dfn[x] = low[x] = ++it;
    col[x] = 1;
    for ( int i = nbs[x]; i; i = next[i] ) {
        if ( use[i] ) continue;
        use[i+(i&1?1:-1)] = 1;
        if ( !dfn[ev[i]] ) {
            dfs( ev[i] );
            low[x] = min( low[x], low[ev[i]] );
            if ( dfn[x] < low[ev[i]] ) ans[edge[num[i]].id] = 2;
        } else if ( col[x] == 1 ) low[x] = min( low[x], dfn[ev[i]] );
    }
    col[x] = 2;
}

bool cmp( edge_t a, edge_t b ) {
    return a.z < b.z;
}

void addedge( int x, int y, int z ) {
    next[++k] = nbs[x];
    ev[k] = y;
    nbs[x] = k;
    num[k] = z;
    use[k] = 0;
}

void work() {
    memset( ans, -1, sizeof(ans) );
    sort( edge, edge+m, cmp );
    for ( int i = 1; i <= n; i++ ) father[i] = i;
    int i = 0;
    while ( i < m ) {
        int j = i;
        while ( j < m && edge[j].z == edge[i].z ) j++;
        for ( int h = i; h < j; h++ ) {
            if ( getfa(edge[h].x) == getfa(edge[h].y) ) ans[edge[h].id] = 0;
            else {
                int x = getfa(edge[h].x), y = getfa(edge[h].y);
                dfn[x] = dfn[y] = low[x] = low[y] = nbs[x] = nbs[y] = col[x] = col[y] = 0;
            }
        }
        k = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            ans[edge[h].id] = 1;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            addedge( x, y, h );
            addedge( y, x, h );
        }
        it = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            if ( !dfn[x] ) dfs(x);
            if ( !dfn[y] ) dfs(y);
        }
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] != 0 ) father[getfa(edge[h].y)] = getfa(edge[h].x);
        }
        i = j;
    }
    for ( int i = 0; i < m; i++ ) {
        if ( ans[i] == 0 ) printf( "none\n" );
        else if ( ans[i] == 1 ) printf( "at least one\n" );
        else printf( "any\n" );
    }
}

int main() {
    init();
    work();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = 100005;

struct edge_t {
    int x, y, z, id;
} edge[maxn];
int nbs[maxn], ev[maxn*2], next[maxn*2], ans[maxn], father[maxn], dfn[maxn], low[maxn], to[maxn], num[maxn*2], use[maxn], n, m, k, it;

void init() {
    scanf( "%d%d", &n, &m );
    for ( int i = 0; i < m; i++ ) scanf( "%d%d%d", &edge[i].x, &edge[i].y, &edge[i].z );
    for ( int i = 0; i < m; i++ ) edge[i].id = i;
}

int getfa( int x ) {
    if ( father[x] != x ) father[x] = getfa( father[x] );
    return father[x];
}

void dfs( int x ) {
    dfn[x] = low[x] = ++it;
    for ( int i = nbs[x]; i; i = next[i] ) {
        if ( use[i] ) continue;
        use[i+(i&1?1:-1)] = 1;
        if ( !dfn[ev[i]] ) {
            to[ev[i]] = i;
            dfs( ev[i] );
            low[x] = min( low[x], low[ev[i]] );
        } else low[x] = min( low[x], dfn[ev[i]] );
        if ( dfn[x] < low[ev[i]] ) ans[edge[num[i]].id] = 2;
    }
}

bool cmp( edge_t a, edge_t b ) {
    return a.z < b.z;
}

void addedge( int x, int y, int z ) {
    next[++k] = nbs[x];
    ev[k] = y;
    nbs[x] = k;
    num[k] = z;
    use[k] = 0;
}

void work() {
    memset( ans, -1, sizeof(ans) );
    sort( edge, edge+m, cmp );
    for ( int i = 1; i <= n; i++ ) father[i] = i;
    int i = 0;
    while ( i < m ) {
        int j = i;
        while ( j < m && edge[j].z == edge[i].z ) j++;
        for ( int h = i; h < j; h++ ) {
            if ( getfa(edge[h].x) == getfa(edge[h].y) ) ans[edge[h].id] = 0;
            else {
                int x = getfa(edge[h].x), y = getfa(edge[h].y);
                dfn[x] = dfn[y] = low[x] = low[y] = nbs[x] = nbs[y] = 0;
            }
        }
        k = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            ans[edge[h].id] = 1;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            to[x] = to[y] = -1;
            addedge( x, y, h );
            addedge( y, x, h );
        }
        it = 0;
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] == 0 ) continue;
            int x = getfa(edge[h].x), y = getfa(edge[h].y);
            if ( !dfn[x] ) dfs(x);
            if ( !dfn[y] ) dfs(y);
        }
        for ( int h = i; h < j; h++ ) {
            if ( ans[edge[h].id] != 0 ) father[getfa(edge[h].y)] = getfa(edge[h].x);
        }
        i = j;
    }
    for ( int i = 0; i < m; i++ ) {
        if ( ans[i] == 0 ) printf( "none\n" );
        else if ( ans[i] == 1 ) printf( "at least one\n" );
        else printf( "any\n" );
    }
}

int main() {
    init();
    work();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void path(int i , int cost);
 void dfs(int start , int end);
 void init();
 bool uniony(int x ,int y);
 void kruksal();
 string state[100001];
int parent[100001],n,m,visi=1,Rank[100001];
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
pair<ii, int> parent2[100001]; // <<fromNode,weight>,edgeNumber>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
int vis[100001] ;
bool flag = false;
void dfs(int start , int End)
{
  vis[start]=visi;
  for(int i = 0 ; i <mst[start].size() ; i++)
  {
    if(vis[mst[start][i].second.first]!=visi)
    {
      parent2[mst[start][i].second.first]=make_pair(make_pair(start,mst[start][i].second.second),mst[start][i].first);
      if(mst[start][i].second.first==End)return;
      dfs(mst[start][i].second.first,End);
    }
  }
}

void path(int i , int cost)
{

   if(parent2[i].first.first==i)return;
   if(parent2[i].first.second==cost)
   {
      state[parent2[i].second]="at least one";
      flag = true ;
   }
   path(parent2[i].first.first , cost);

}

void init()
{
    for(int i = 1 ; i <= n ; i++){
        parent[i] = i;
    }
}
int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_j = Find(y);
    if(r_i == r_j)return false;
     if(Rank[r_i]<Rank[r_j]) parent[r_i]=r_j;
    else if(Rank[r_i]>Rank[r_j]) parent[r_j]=r_i;
    else{
    parent[r_i]=r_j;
    Rank[r_j]++;
    }
return true;
}
void kruksal()
{
    sort(edges.begin(),edges.end());
    init();
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag = false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
         visi++;

         parent2[edges[i].second.first]=make_pair(make_pair(edges[i].second.first,0),edges[i].first.second);

         dfs(edges[i].second.first,edges[i].second.second);
         path(edges[i].second.second,edges[i].first.first);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }

      }
    }
}
int main()
{
  ios::sync_with_stdio(false) ;
  cin.tie(0);
  cin>>n>>m;
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
   kruksal();
  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<endl;
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void dfs(int start , int end);
 bool uniony(int x ,int y),f=false;
 void kruksal();
 int ans[100001];
 char state[][20] = {"none","at least one","any"};
int parent[100001],n,m,visi=1,Rank[100001],w[1000005];;
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
 // <<fromNode,weight>,edgeNumber>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
int vis[100001] , cost ;
bool flag = false;
void dfs(int start , int End)
{
  vis[start]=visi;
  for(int i = 0 ; i <mst[start].size()  &&!f ; i++)
  {
    if(vis[mst[start][i].second.first]!=visi)
    {
      //parent2[mst[start][i].second.first]=make_pair(make_pair(start,mst[start][i].second.second),mst[start][i].first);
      if(mst[start][i].second.first==End){
            f=true;
            if(mst[start][i].second.second==cost)
            {
               ans[mst[start][i].first]= 1;
                flag = true ;
             }
            return;
      }
      dfs(mst[start][i].second.first,End);
            if(mst[start][i].second.second==cost&&f)
            {
                ans[mst[start][i].first]=1;
                flag = true ;
             }
    }
  }
}

int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_j = Find(y);
    if(r_i == r_j)return false;
     if(Rank[r_i]<Rank[r_j]) parent[r_i]=r_j;
    else if(Rank[r_i]>Rank[r_j]) parent[r_j]=r_i;
    else{
    parent[r_i]=r_j;
    Rank[r_j]++;
    }
return true;
}
void kruksal()
{
    sort(edges.begin(),edges.end());
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag =f= false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
             w[edges[i].first.first]=true;
            ans[edges[i].first.second] = 2;
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
          if(w[edges[i].first.first])
          {
         visi++;
         cost = edges[i].first.first;
         dfs(edges[i].second.first,edges[i].second.second);
         //path(edges[i].second.second,edges[i].first.first);
        if(!flag)
        {
           ans[edges[i].first.second]=0;
        }else
        {
            ans[edges[i].first.second]=1;
        }
          }
          else{
            ans[edges[i].first.second]=0;
          }
      }
    }
}
int main()
{
   scanf("%d%d",&n,&m);
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    scanf("%d%d%d",&f,&t,&c);
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
     parent[i] = i;
  }
   kruksal();
  for(int i = 1  ; i <=m ; i++)
  {
    printf("%s\n",state[ans[i]]);
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void path(int i , int cost);
 void dfs(int start , int end);
 void init();
 bool uniony(int x ,int y);
 void kruksal();
 string state[100001];
int parent[100001],n,m;
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
pair<ii, int> parent2[100001]; // <<fromNode,weight>,edgeNumber>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
bool vis[100001] , flag = false;
void dfs(int start , int End)
{
  vis[start]=true;
  for(int i = 0 ; i <mst[start].size() ; i++)
  {
    if(!vis[mst[start][i].second.first])
    {
      parent2[mst[start][i].second.first]=make_pair(make_pair(start,mst[start][i].second.second),mst[start][i].first);
      if(mst[start][i].second.first==End)return;
      dfs(mst[start][i].second.first,End);
    }
  }
}

void path(int i , int cost)
{

   if(parent2[i].first.first==i)return;
   if(parent2[i].first.second==cost)
   {
      state[parent2[i].second]="at least one";
      flag = true ;
   }
   path(parent2[i].first.first , cost);

}

void init()
{
    for(int i = 1 ; i <= n ; i++)
        parent[i] = i;
}
int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_y = Find(y);
    if(r_i == r_y)return false;
    parent[r_i] = r_y;
    return true;
}
void kruksal()
{
    sort(edges.begin(),edges.end());
    init();
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag = false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
         memset(parent2,0 , sizeof(parent2));
         memset(vis,false , sizeof(vis));

         parent2[edges[i].second.first]=make_pair(make_pair(edges[i].second.first,0),edges[i].first.second);

         dfs(edges[i].second.first,edges[i].second.second);
         path(edges[i].second.second,edges[i].first.first);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }

      }
    }
}
int main()
{
  ios::sync_with_stdio(false) ;
  cin.tie(0);
  cin>>n>>m;
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    //edgeWeight,edgenumber>> <<fromNode,toNode>>
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
   kruksal();
  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<endl;
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void path(int i , int cost);
 void dfs(int start , int end);
 void init();
 bool uniony(int x ,int y),f=false;
 void kruksal();
 string state[100001];
int parent[100001],n,m,visi=1,Rank[100001];
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
pair<ii, int> parent2[100001]; // <<fromNode,weight>,edgeNumber>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
int vis[100001] , cost ;
bool flag = false;
void dfs(int start , int End)
{
  vis[start]=visi;
  for(int i = 0 ; i <mst[start].size()  &&!f ; i++)
  {
    if(vis[mst[start][i].second.first]!=visi)
    {
      //parent2[mst[start][i].second.first]=make_pair(make_pair(start,mst[start][i].second.second),mst[start][i].first);
      if(mst[start][i].second.first==End){
            f=true;
            if(mst[start][i].second.second==cost)
            {
                state[mst[start][i].first]="at least one";
                flag = true ;
             }
            return;
      }
      dfs(mst[start][i].second.first,End);
            if(mst[start][i].second.second==cost&&f)
            {
                state[mst[start][i].first]="at least one";
                flag = true ;
             }
    }
  }
}

/*void path(int i , int cost)
{

   if(parent2[i].first.first==i)return;
   if(parent2[i].first.second==cost)
   {
      state[parent2[i].second]="at least one";
      flag = true ;
   }
   path(parent2[i].first.first , cost);

}*/

void init()
{
    for(int i = 1 ; i <= n ; i++){
        parent[i] = i;
    }
}
int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_j = Find(y);
    if(r_i == r_j)return false;
     if(Rank[r_i]<Rank[r_j]) parent[r_i]=r_j;
    else if(Rank[r_i]>Rank[r_j]) parent[r_j]=r_i;
    else{
    parent[r_i]=r_j;
    Rank[r_j]++;
    }
return true;
}
void kruksal()
{
    sort(edges.begin(),edges.end());
    init();
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag =f= false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
         visi++;

         parent2[edges[i].second.first]=make_pair(make_pair(edges[i].second.first,0),edges[i].first.second);
         cost = edges[i].first.first;
         dfs(edges[i].second.first,edges[i].second.second);
         //path(edges[i].second.second,edges[i].first.first);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }

      }
    }
}
int main()
{
  ios::sync_with_stdio(false) ;
  cin.tie(0);
  cin>>n>>m;
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
   kruksal();
  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<endl;
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void path(int i , int cost);
 void dfs(int start , int end);
 void init();
 bool uniony(int x ,int y);
 void kruksal();
 string state[100001];
int parent[100001],n,m,visi=1,Rank[100001];
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
pair<ii, int> parent2[100001]; // <<fromNode,weight>,edgeNumber>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
int vis[100001] ;
bool flag = false;
void dfs(int start , int End)
{
  vis[start]=visi;
  for(int i = 0 ; i <mst[start].size() ; i++)
  {
    if(vis[mst[start][i].second.first]!=visi)
    {
      parent2[mst[start][i].second.first]=make_pair(make_pair(start,mst[start][i].second.second),mst[start][i].first);
      if(mst[start][i].second.first==End)return;
      dfs(mst[start][i].second.first,End);
    }
  }
}

void path(int i , int cost)
{

   if(parent2[i].first.first==i)return;
   if(parent2[i].first.second==cost)
   {
      state[parent2[i].second]="at least one";
      flag = true ;
   }
   path(parent2[i].first.first , cost);

}

void init()
{
    for(int i = 1 ; i <= n ; i++){
        parent[i] = i;
    }
}
int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_j = Find(y);
    if(r_i == r_j)return false;
     if(Rank[r_i]<Rank[r_j]) parent[r_i]=r_j;
    else if(Rank[r_i]>Rank[r_j]) parent[r_j]=r_i;
    else{
    parent[r_i]=r_j;
    Rank[r_j]++;
    }
return true;
}
void kruksal()
{
    sort(edges.begin(),edges.end());
    init();
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag = false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
         visi++;

         parent2[edges[i].second.first]=make_pair(make_pair(edges[i].second.first,0),edges[i].first.second);

         dfs(edges[i].second.first,edges[i].second.second);
         path(edges[i].second.second,edges[i].first.first);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }

      }
    }
}
int main()
{
  ios::sync_with_stdio(false) ;
  cin.tie(0);
scanf("%d%d",&n,&m);
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
   kruksal();
  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<"\n";
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void path(int i , int cost);
 void dfs(int start , int end);
 void init();
 bool uniony(int x ,int y);
 void kruksal();
 string state[100001];
int parent[100001],n,m,visi=1,Rank[100001];
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
pair<ii, int> parent2[100001]; // <<fromNode,weight>,edgeNumber>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
int vis[100001] ;
bool flag = false;
void dfs(int start , int End)
{
  vis[start]=visi;
  for(int i = 0 ; i <mst[start].size() ; i++)
  {
    if(vis[mst[start][i].second.first]!=visi)
    {
      parent2[mst[start][i].second.first]=make_pair(make_pair(start,mst[start][i].second.second),mst[start][i].first);
      if(mst[start][i].second.first==End)return;
      dfs(mst[start][i].second.first,End);
    }
  }
}

void path(int i , int cost)
{

   if(parent2[i].first.first==i)return;
   if(parent2[i].first.second==cost)
   {
      state[parent2[i].second]="at least one";
      flag = true ;
   }
   path(parent2[i].first.first , cost);

}

void init()
{
    for(int i = 1 ; i <= n ; i++){
        parent[i] = i;
    }
}
int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_j = Find(y);
    if(r_i == r_j)return false;
     if(Rank[r_i]<Rank[r_j]) parent[r_i]=r_j;
    else if(Rank[r_i]>Rank[r_j]) parent[r_j]=r_i;
    else{
    parent[r_i]=r_j;
    Rank[r_j]++;
    }
return true;
}
void kruksal()
{
    sort(edges.begin(),edges.end());
    init();
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag = false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
         visi++;

         parent2[edges[i].second.first]=make_pair(make_pair(edges[i].second.first,0),edges[i].first.second);

         dfs(edges[i].second.first,edges[i].second.second);
         path(edges[i].second.second,edges[i].first.first);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }

      }
    }
}
int main()
{

   scanf("%d%d",&n,&m);
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
   kruksal();
  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<"\n";
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void dfs(int start , int end);
 bool uniony(int x ,int y),f=false;
 string state[100001];
int parent[100001],n,m,visi=1,Rank[100001];
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
int vis[100001] , cost ;
bool flag = false ,w[1000005];
void dfs(int start , int End)
{
  vis[start]=visi;
  for(int i = 0 ; i <mst[start].size()  &&!f ; i++)
  {
    if(vis[mst[start][i].second.first]!=visi)
    {
      if(mst[start][i].second.first==End){
            f=true;
            if(mst[start][i].second.second==cost)
            {
                state[mst[start][i].first]="at least one";
                flag = true ;
             }
            return;
      }
      dfs(mst[start][i].second.first,End);
            if(mst[start][i].second.second==cost&&f)
            {
                state[mst[start][i].first]="at least one";
                flag = true ;
             }
    }
  }
}

int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_j = Find(y);
    if(r_i == r_j)return false;
     if(Rank[r_i]<Rank[r_j]) parent[r_i]=r_j;
    else if(Rank[r_i]>Rank[r_j]) parent[r_j]=r_i;
    else{
    parent[r_i]=r_j;
    Rank[r_j]++;
    }
return true;
}

int main()
{
  ios::sync_with_stdio(false) ;
  cin.tie(0);
  cin>>n>>m;
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    parent[i]=i;
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
sort(edges.begin(),edges.end());
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag =f= false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            w[edges[i].first.first]=true;
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
        if(w[edges[i].first.first]){
         visi++;
         cost = edges[i].first.first;
         dfs(edges[i].second.first,edges[i].second.second);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }
        }else{
           state[edges[i].first.second]="none";
        }

      }
    }  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<endl;
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void dfs(int start , int end);
 bool uniony(int x ,int y),f=false;
 string state[100001];
int parent[100001],n,m,visi=1,Rank[100001];
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
int vis[100001] , cost ;
bool flag = false;
void dfs(int start , int End)
{
  vis[start]=visi;
  for(int i = 0 ; i <mst[start].size()  &&!f ; i++)
  {
    if(vis[mst[start][i].second.first]!=visi)
    {
      if(mst[start][i].second.first==End){
            f=true;
            if(mst[start][i].second.second==cost)
            {
                state[mst[start][i].first]="at least one";
                flag = true ;
             }
            return;
      }
      dfs(mst[start][i].second.first,End);
            if(mst[start][i].second.second==cost&&f)
            {
                state[mst[start][i].first]="at least one";
                flag = true ;
             }
    }
  }
}

int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_j = Find(y);
    if(r_i == r_j)return false;
     if(Rank[r_i]<Rank[r_j]) parent[r_i]=r_j;
    else if(Rank[r_i]>Rank[r_j]) parent[r_j]=r_i;
    else{
    parent[r_i]=r_j;
    Rank[r_j]++;
    }
return true;
}

int main()
{
  ios::sync_with_stdio(false) ;
  cin.tie(0);
  cin>>n>>m;
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    parent[i]=i;
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
sort(edges.begin(),edges.end());
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag =f= false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
         visi++;
         cost = edges[i].first.first;
         dfs(edges[i].second.first,edges[i].second.second);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }

      }
    }  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<endl;
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void path(int i , int cost);
 void dfs(int start , int end);
 void init();
 bool uniony(int x ,int y);
 void kruksal();
 string state[100001];
int parent[100001],n,m;
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
pair<ii, int> parent2[100001]; // <<fromNode,weight>,edgeNumber>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
bool vis[100001] , flag = false;
void dfs(int start , int End)
{
  vis[start]=true;
  for(int i = 0 ; i <mst[start].size() ; i++)
  {
    if(!vis[mst[start][i].second.first])
    {
      parent2[mst[start][i].second.first]=make_pair(make_pair(start,mst[start][i].second.second),mst[start][i].first);
      if(mst[start][i].second.first==End)return;
      dfs(mst[start][i].second.first,End);
    }
  }
}

void path(int i , int cost)
{

   if(parent2[i].first.first==i)return;
   if(parent2[i].first.second==cost)
   {
      state[parent2[i].second]="at least one";
      flag = true ;
   }
   path(parent2[i].first.first , cost);

}

void init()
{
    for(int i = 1 ; i <= n ; i++)
        parent[i] = i;
}
int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_y = Find(y);
    if(r_i == r_y)return false;
    parent[r_i] = r_y;
    return true;
}
void kruksal()
{
    sort(edges.begin(),edges.end());
    init();
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag = false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
         memset(parent2,0 , sizeof(parent2));
         memset(vis,false , sizeof(vis));

         parent2[edges[i].second.first]=make_pair(make_pair(edges[i].second.first,0),edges[i].first.second);

         dfs(edges[i].second.first,edges[i].second.second);
         for(int i = 1  ;i<=n ; i++)cout<<parent2[i].first.first<<" ";cout<<endl;
         path(edges[i].second.second,edges[i].first.first);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }

      }
    }
}
int main()
{
  cin>>n>>m;
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    //edgeWeight,edgenumber>> <<fromNode,toNode>>
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
   kruksal();
  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<endl;
  }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair<int ,int> ii;
 void dfs(int start , int end);
 bool uniony(int x ,int y),f=false;
 void kruksal();
 string state[100001];
int parent[100001],n,m,visi=1,Rank[100001];
vector <pair<pair<int ,int> ,pair<int ,int> > > edges; // <<edgeWeight,edgenumber>> <<fromNode,toNode>>
vector<pair<int ,ii> > mst[100001]; // <edgeNumber,<toNode,weight>>
int vis[100001] , cost ;
bool flag = false;
void dfs(int start , int End)
{
  vis[start]=visi;
  for(int i = 0 ; i <mst[start].size()  &&!f ; i++)
  {
    if(vis[mst[start][i].second.first]!=visi)
    {
      if(mst[start][i].second.first==End){
            f=true;
            if(mst[start][i].second.second==cost)
            {
                state[mst[start][i].first]="at least one";
                flag = true ;
             }
            return;
      }
      dfs(mst[start][i].second.first,End);
            if(mst[start][i].second.second==cost&&f)
            {
                state[mst[start][i].first]="at least one";
                flag = true ;
             }
    }
  }
}

int Find(int i )
{
 if(parent[i] == i)return i;
 return parent[i] = Find(parent[i]);
}
bool uniony(int x ,int y)
{
    int r_i = Find(x);
    int r_j = Find(y);
    if(r_i == r_j)return false;
     if(Rank[r_i]<Rank[r_j]) parent[r_i]=r_j;
    else if(Rank[r_i]>Rank[r_j]) parent[r_j]=r_i;
    else{
    parent[r_i]=r_j;
    Rank[r_j]++;
    }
return true;
}
void kruksal()
{
    sort(edges.begin(),edges.end());
    for(int i = 0 ; i < edges.size() ; i++)
    {
        flag =f= false;
        if(uniony(edges[i].second.first,edges[i].second.second))
        {
            state[edges[i].first.second] = "any";
            mst[edges[i].second.first].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.second,edges[i].first.first)));
            mst[edges[i].second.second].push_back(make_pair(edges[i].first.second,make_pair(edges[i].second.first, edges[i].first.first)));
        }
      else
      {
         visi++;
         cost = edges[i].first.first;
         dfs(edges[i].second.first,edges[i].second.second);
        if(!flag)
        {
           state[edges[i].first.second]="none";
        }else
        {
            state[edges[i].first.second]="at least one";
        }

      }
    }
}
int main()
{
  ios::sync_with_stdio(false) ;
  cin.tie(0);
  cin>>n>>m;
  for(int i = 1 ; i <=m ; i++)
  {
    int f ,t , c ;
    cin>>f>>t>>c;
    parent[i]=i;
    edges.push_back(make_pair(make_pair(c,i),make_pair(f,t)));
  }
   kruksal();
  for(int i = 1  ; i <=m ; i++)
  {
     cout<<state[i]<<endl;
  }

    return 0;
}