#include #define MOD 1000000007 #define INF (1<<30) #define INFL (1<<62) #define pe(str) return cout<<(str)<=0;i--) #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b);i>=(a);i--) #define bw(a,b,c) (((a)<=(b))&&((b)<=(c))) #define hello cout<<"hello"<>n using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair pii; typedef complex point; template void dump(InputIterator first,InputIterator last,char delim=' '){ for(InputIterator it=first;it!=last;it++){ if(it!=first)cout< void swp(T &a,T &b){ T t=a; a=b; b=t; } int main(void){ int a[11][11]; int s[10]; int n,m; int c,cc,ccc; int t=0; int sum=0; cin>>n>>m; re(i,n) re(j,n) a[i][j]=0; re(i,m){cin>>c>>cc;cin>>a[c][cc];} re(i,n) s[i]=i; do{ sum=0; re(i,n){ rep(j,i+1,n){ sum+=a[s[i]][s[j]]; } } t=max(t,sum); }while(next_permutation(s,s+n)); cout<