#include #include //#include using ll=long long; #define rep(i,a,b) for(int i=a;i; using PD=pair; using PL=pair; int mod1=998244353; int mod2=1000000007; const ll INF = 1e18; const int big = 2147483647; int value[2000010],NN=1,lazy[2000010]; bool jud[2000010]; struct st{ ll x,y,z; st(ll x=0,ll y=0,ll z=0):x(x),y(y),z(z){} bool operator>(const st &a)const{ return x>a.x; } }; int pr[20][20]; ll dp[100000]; int main(){ ll n,q,y=0,i,z=0,x=0,d=0,k,L,nk,sum=0,T; ll ans=INF,sum2=0,rs=-1e9,cs=0,l=0,h=0,w=0,r=0,X; ll tmp2=0,flag=0,a=0,b=0,c=0,j=0,m=0,p,S,K; ll N,M=0; cin>>N>>M; rep(i,0,1<>x>>y>>z; pr[x][y]=z; dp[(1<>j)&1)continue; rep(k,0,N){ if(!((i>>k)&1))continue; dp[i | (1<