#include using namespace std; int n1[3005][3005]; int m1[3005]; int main(){ int n; int m; while(~scanf("%d %d",&n,&m)){ memset(n1,0,sizeof(n1)); int j=0; int min=0x3f3f3f3f; for(int i=0;i>a>>b>>c; n1[a][b]+=c; n1[b][a]+=c; } vectora1; a1.clear(); for(int i=1;i<=n;i++){ int sum=0; for(int j=1;j<=n;j++) { if(i==j) continue; sum+=n1[i][j]; }a1.push_back(sum); } sort(a1.begin(),a1.end()); cout<