#include using namespace std; #define int long long typedef pairpint; typedef vectorvint; typedef vectorvpint; #define pb push_back #define mp make_pair #define fi first #define se second #define all(v) (v).begin(),(v).end() #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++) templatevoid chmin(T &t,U f){if(t>f)t=f;} templatevoid chmax(T &t,U f){if(t>n>>m; rep(i,m){ cin>>a[i]>>b[i]>>c[i]; a[i]--;b[i]--; } vint p(n);rep(i,n)p[i]=i; int ma=0; do{ int sum=0; rep(i,m){ if(p[a[i]]