#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2> P) {
  out << '(' << P.first << ',' << P.second << ')';
  return out;
}
const int maxn = 15;
const int INF = 0x3f3f3f3f;
int es[1 << maxn];
int adj[maxn][maxn];
int dp[maxn][1 << maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  long long tt = 0;
  for (int i = 0; i < ((int)m); i++) {
    int u, v, d;
    cin >> u >> v >> d;
    u--;
    v--;
    adj[u][v] = adj[v][u] = d;
    tt += d;
  }
  return 0;
}
