#include<bits/stdc++.h>
using namespace std;
#define scl(x) scanf("%lld",&x)
#define sc(x) scanf("%d",&x)
#define ll long long
#define lop(i,n) for(int i=0;i<n;++i)
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
const int N=805;
double mx[N][N];
int n,m;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin>>n>>m;
//sc(n),sc(m);
int x = -1e9;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
mx[i][j]=x;
int a,b;
double c;
lop(i,m){
//sc(a);sc(b);
//scanf("%lf",&c);
cin>>a>>b>>c;
--a;
--b;
mx[a][b]=fmax(mx[a][b],log(c));
}
for(int k = 0 ; k<n ; ++k)
for(int i = 0 ; i<n ; ++i)
for(int j = 0 ; j<n ; ++j)
mx[i][j]=fmax(mx[i][j],mx[i][k]+mx[k][j]);
for(int i=0;i<n;i++)
if(mx[i][i]>0)
return puts("inadmissible");
puts("admissible");
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNkZWZpbmUgc2NsKHgpIHNjYW5mKCIlbGxkIiwmeCkKI2RlZmluZSBzYyh4KSAgc2NhbmYoIiVkIiwmeCkKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSBsb3AoaSxuKSBmb3IoaW50IGk9MDtpPG47KytpKQp0eXBlZGVmIHBhaXI8aW50LCBpbnQ+IGlpOwp0eXBlZGVmIHBhaXI8bGwsIGxsPiBwbGw7Cgpjb25zdCBpbnQgTj04MDU7CiBkb3VibGUgbXhbTl1bTl07CmludCBuLG07CgppbnQgbWFpbigpewoJaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CgljaW4udGllKG51bGxwdHIpOwoJY2luPj5uPj5tOwoJLy9zYyhuKSxzYyhtKTsKICAgIGludCB4ID0gLTFlOTsKCWZvcihpbnQgaT0wO2k8bjtpKyspCgkJZm9yKGludCBqPTA7ajxuO2orKykKCQkJbXh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