#include #define rep(i,n) for (int i=0; i<(n); ++i) using namespace std; using ll = long long; using P = pair; ll dp[305][305][305]; const int mod=1e9+7; int main(){ int n,m,k; cin>>n>>m>>k; vectorp(m),q(m),c(m); rep(i,m)cin>>p[i]>>q[i]>>c[i]; for(int i=1; i<=300; ++i){ dp[0][i][0]=1; } for(int i=0; i