#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct canal {
int x, y, t;
};
int main() {
int n, m;
vector <canal> canals;
cin >> n >> m;
canal r;
for (int i=0; i < m; i++)
{
cin >> r.x >> r.y >> r.t;
canals.push_back(r);
}
const int INF = 2000000;
vector <int> distance (n);
int x;
for (int i = 0; i < n; i++) {
x = -1;
for (int j = 0; j < m; j++)
if (distance[canals[j].y] > distance[canals[j].x] + canals[j].t) {
distance[canals[j].y] = max (-INF, distance[canals[j].x] + canals[j].t);
x = canals[j].y;
}
}
if (x == -1)
cout << "not possible" << endl;
else {
cout << "possible" << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpzdHJ1Y3QgY2FuYWwgewoJaW50IHgsIHksIHQ7Cn07CiAKaW50IG1haW4oKSB7CglpbnQgbiwgbTsKCXZlY3RvciA8Y2FuYWw+IGNhbmFsczsKCWNpbiA+PiBuID4+IG07CgljYW5hbCByOwoJZm9yIChpbnQgaT0wOyBpIDwgbTsgaSsrKQoJewoJCWNpbiA+PiByLnggPj4gci55ID4+IHIudDsKCQljYW5hbHMucHVzaF9iYWNrKHIpOwoJfQoJY29uc3QgaW50IElORiA9IDIwMDAwMDA7Cgl2ZWN0b3IgPGludD4gZGlzdGFuY2UgKG4pOwoJaW50IHg7Cglmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewoJCXggPSAtMTsKCQlmb3IgKGludCBqID0gMDsgaiA8IG07IGorKykKCQkJaWYgKGRpc3RhbmNlW2NhbmFsc1tqXS55XSA+IGRpc3RhbmNlW2NhbmFsc1tqXS54XSArIGNhbmFsc1tqXS50KSB7CgkJCQlkaXN0YW5jZVtjYW5hbHNbal0ueV0gPSBtYXggKC1JTkYsIGRpc3RhbmNlW2NhbmFsc1tqXS54XSArIGNhbmFsc1tqXS50KTsKCQkJCXggPSBjYW5hbHNbal0ueTsKCQkJfQoJfQogCglpZiAoeCA9PSAtMSkKCQljb3V0IDw8ICJub3QgcG9zc2libGUiIDw8IGVuZGw7CgllbHNlIHsKCQljb3V0IDw8ICJwb3NzaWJsZSIgPDwgZW5kbDsKCX0KCXJldHVybiAwOwp9