Problem: Escape

An undirected graph with positive values ​​at the vertices is given. The vertices are numbered from 1 to N, and the i-th vertex has a value of w_i. You can start from the first vertex and move on the graph with the constraint that you cannot pass the edge that you just passed. At each vertex, you can get the score of the value that the vertex has only when you visit it for the first time.

Find the maximum sum of the points you can get.

Constraints

* 1 ≤ N ≤ 100000
* N − 1 ≤ M ≤ 100000
* 1 ≤ w_i ≤ 1000
* 1 ≤ u_i, v_i ≤ N
* There are no multiple edges or self edges
* The graph is concatenated



Input Format

Input is given from standard input in the following format.


N M
w_1 w_2 ... w_N
u_1 v_1
u_2 v_2
...
u_M v_M


In the first line, the number of vertices N of the graph and the integer M representing the number of edges are entered.
The value w_i of each vertex is entered in the second line.
In addition, the number of the two vertices connected by each side is entered in the M line.


Output Format

Print the answer on one line.

Sample Input 1


6 6
1 2 3 4 5 6
1 2
twenty three
3 4
14
4 5
5 6


Sample Output 1


twenty one


<image>
You can collect the points of all vertices by going from vertices 1 → 2 → 3 → 4 → 5 → 6.

Sample Input 2


7 8
1 3 3 5 2 2 3
1 2
twenty three
3 1
14
1 7
1 5
1 6
5 6


Sample Output 2


16


<image>
You can collect 16 points by going from vertices 1 → 2 → 3 → 1 → 5 → 6 → 1 → 4.





Example

Input

6 6
1 2 3 4 5 6
1 2
2 3
3 4
1 4
4 5
5 6


Output

21

Solution (in CPP):

Solution:
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(i,v.size())cout<<" "<<v[i];cout<<endl<<endl;
#define show2d(v) rep(i,v.size()){rep(j,v[i].size())cout<<" "<<v[i][j];cout<<endl;}cout<<endl;
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<int,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};//ESWN
class BRI{
	public:
	int n,N;
	vi order,inS,cmp;
	vp brg;
	vvi G,each_bcc;
	// N : scc後の頂点数
	// brg : 橋一覧
	// each_bcc : 二重連結成分のリスト
	// cmp : ある頂点がどの二重連結成分に含まれているか
	stack<int> roots, S;
	BRI(int size){
		n=size;
		G=vvi(n);
	}
	void add_edge(int s,int t){
		G[s].pb(t);
		G[t].pb(s);
	}
	void visit(int cur,int prev,int &k){
		order[cur]=++k;
		S.push(cur);
		inS[cur]=true;
		roots.push(cur);
		
		rep(i,G[cur].size()){
			int to=G[cur][i];
			if(!order[to])visit(to,cur,k);
			else if(to!=prev&&inS[to])
				while(order[roots.top()]>order[to])roots.pop();
		}
		
		if(cur==roots.top()){
			if(prev!=-1)brg.pb({prev,cur});
			vi bcc;
			while(1){
				int node=S.top();
				S.pop();
				inS[node]=false;
				bcc.pb(node);
				cmp[node]=N;
				if(node==cur)break;
			}
			N++;
			each_bcc.pb(bcc);
			roots.pop();
		}
	}
	void bri(){
		N=0;
		order=inS=cmp=vi(n);
		roots=S=stack<int>();
		int k=0;
		rep(i,n)if(order[i]==0)
			visit(i,-1,k);
	}
	vvi make(){
		vvi tG(N);
		rep(i,brg.size()){
			int a=brg[i].first,b=brg[i].second;
			tG[cmp[a]].pb(cmp[b]);
			tG[cmp[b]].pb(cmp[a]);
		}
		return tG;
	}
	vvi f(vi w){
		vvi out(N,vi(2));
		rep(i,n){
			out[cmp[i]][1]++;
			out[cmp[i]][0]+=w[i];
		}
		return out;
	}
};
vvi data;
int n,m;
vvi G;
vi used;
pii dfs(int a){
	int out1=0,out2=0;
	used[a]=true;
	rep(i,G[a].size())if(used[G[a][i]]==0){
		pii t=dfs(G[a][i]);
		out1=max(out1,t.first);
		out2+=t.second;
	}
	if(out2||data[a][1]-1)out2+=data[a][0];
	else out1+=data[a][0];
	return {out1,out2};
}
int main(){
	cin>>n>>m;
	vi w(n);
	rep(i,n)cin>>w[i];
	BRI bri(n);
	while(m--){
		int a,b;
		cin>>a>>b;
		a--;b--;
		bri.add_edge(a,b);
	}
	bri.bri();
	n=bri.N;
	G=bri.make();
	data=bri.f(w);
	used=vi(n);
	pii ans=dfs(bri.cmp[0]);
	cout<<ans.first+ans.second<<endl;
}