Problem: Mole decided to live in an abandoned mine. The structure of the mine is represented by a simple connected undirected graph which consists of N vertices numbered 1 through N and M edges. The i-th edge connects Vertices a_i and b_i, and it costs c_i yen (the currency of Japan) to remove it.

Mole would like to remove some of the edges so that there is exactly one path from Vertex 1 to Vertex N that does not visit the same vertex more than once. Find the minimum budget needed to achieve this.

Constraints

* 2 \leq N \leq 15
* N-1 \leq M \leq N(N-1)/2
* 1 \leq a_i, b_i \leq N
* 1 \leq c_i \leq 10^{6}
* There are neither multiple edges nor self-loops in the given graph.
* The given graph is connected.

Input

Input is given from Standard Input in the following format:


N M
a_1 b_1 c_1
:
a_M b_M c_M


Output

Print the answer.

Examples

Input

4 6
1 2 100
3 1 100
2 4 100
4 3 100
1 4 100
3 2 100


Output

200


Input

2 1
1 2 1


Output

0


Input

15 22
8 13 33418
14 15 55849
7 10 15207
4 6 64328
6 9 86902
15 7 46978
8 14 53526
1 2 8720
14 12 37748
8 3 61543
6 5 32425
4 11 20932
3 12 55123
8 2 45333
9 12 77796
3 9 71922
12 15 70793
2 4 25485
11 6 1436
2 7 81563
7 11 97843
3 1 40491


Output

133677

Solution (in CPP):

Solution:
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int n,m;
int H[20][20];
int F[1<<15|1][17],Cost[1<<15|1][17];
int Cost2[1<<15|1],B[1<<15|1];
const int INF=0x7f7f7f7f;
void Init(){
	for(int s=0;s<(1<<n);++s)
		for(int i=0;i<n;++i)
			if(s>>i&1) for(int j=0;j<n;++j)
				if(!(s>>j&1)) Cost[s][j]+=H[i][j];
}
int main(){
	scanf("%d%d",&n,&m);
	int a,b,c;
	for(int i=1;i<=m;++i){
		scanf("%d%d%d",&a,&b,&c);
		--a; --b;
		H[a][b]=H[b][a]=c;
	}
	Init();
	int N=(1<<(n-1)),M;
	memset(F,0x7f,sizeof(F));
	F[1][0]=0;
	for(int s=0,t,i,x,j,s2;s<N;++s){
		t=(s<<1|1);
		for(i=0;i<n;++i){
			if(F[t][i]==INF) continue;
			if(!(t>>i&1)) continue;
			x=F[t][i];
			for(j=0;j<n;++j){
				if(!(t>>j&1)&&H[i][j]){
					F[t|(1<<j)][j]=min(F[t|(1<<j)][j],x+Cost[t^(1<<i)][j]);
				}
			}
			M=((1<<n)-1-t);
			for(j=0;j<n;++j)
				if(M>>j&1) Cost2[1<<j]=Cost[t^(1<<i)][j];
			for(s2=M,j=0;s2;s2=(s2-1)&M) B[j++]=s2;
			for(;~j;--j) if(B[j]&(B[j]-1)) Cost2[B[j]]=Cost2[B[j]&(B[j]-1)]+Cost2[B[j]&(-B[j])];
			for(s2=M;s2;s2=(s2-1)&M){
				F[t|s2][i]=min(F[t|s2][i],x+Cost2[s2]);
			}
		}
	}
	printf("%d\n",F[(1<<n)-1][n-1]);
	getchar(); getchar();
	return 0;
}