#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;
long 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+IGlpOwp0eXBlZGVmIHBhaXI8bGwsIGxsPiBwbGw7Cgpjb25zdCBpbnQgTj04MDU7CmxvbmcgZG91YmxlIG14W05dW05dOwppbnQgbixtOwoKaW50IG1haW4oKXsKCWlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwoJY2luLnRpZShudWxscHRyKTsKCWNpbj4+bj4+bTsKCS8vc2Mobiksc2MobSk7CiAgICBpbnQgeCA9IC0xZTk7Cglmb3IoaW50IGk9MDtpPG47aSsrKQoJCWZvcihpbnQgaj0wO2o8bjtqKyspC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