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:
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

ll N, M, W[100000], cnt[100000];
vector<ll> E[100000], candidate;
bool visited[100000], check[100000];

void dfs_candidate(ll v) {
  visited[v] = true;
  for(ll u : E[v]) if(!visited[u]) {
    if(!check[v] && check[u]) candidate.push_back(u);
    else dfs_candidate(u);
  }
}

ll dfs(ll v) {
  ll ret = 0;
  visited[v] = true;
  for(ll u : E[v]) if(!visited[u]) ret = max(ret, dfs(u));
  return ret + W[v];
}

int main(void) {
  cin >> N >> M;
  REP(i, 0, N) cin >> W[i];
  REP(i, 0, M) {
    ll U, V; cin >> U >> V; U--; V--;
    E[U].push_back(V);
    E[V].push_back(U);
  }

  queue<ll> q;
  REP(i, 0, N) cnt[i] = E[i].size();
  REP(i, 1, N) if(cnt[i] == 1) q.push(i);
  REP(i, 0, N) check[i] = false;
  while(q.size()) {
    ll v = q.front();
    q.pop();
    if(v == 0) continue;
    check[v] = true;
    for(ll u : E[v]) if(--cnt[u] == 1) q.push(u);
  }

  REP(i, 0, N) visited[i] = false;
  dfs_candidate(0);

  ll ans = 0;
  REP(i, 0, N) visited[i] = false;
  REP(i, 0, N) if(!check[i]) visited[i] = true;
  for(ll v : candidate) ans = max(ans, dfs(v));
  REP(i, 0, N) if(!check[i]) ans += W[i];
  cout << ans << endl;
}