#include using namespace std; #define ALL(c) (c).begin(),(c).end() #define PB push_back #define IN(x,c) (find(c.begin(),c.end(),x) != (c).end()) #define REP(i,n) for (int i=0;i<(int)(n);i++) #define FOR(i,a,b) for (int i=(a);i<=(b);i++) #define INIT(a,v) memset(a,v,sizeof(a)) template A cvt(B x) { stringstream ss; ss<>y; return y; } #define SPC << " " << #define DEBUG(x) cerr << #x << " = "; cerr << x << endl; #define DEBUG_ITER(x) cerr << #x << " = "; for (auto _ : x) cerr << _ << ' '; cerr << endl; typedef long long int64; typedef pair PII; typedef vector VI; typedef array III; #define N 10 #define INF 1000000000 int n,m; int a[N][N]; int mem[N][1<> n >> m; REP (i,m) { int x,y,z; cin >> x >> y >> z; a[x][y]=z; a[y][x]=z; } cout << solve(0,1) << endl; return 0; }