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,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

vector<int> G[MAX_N];
ll f[MAX_N];
int x[MAX_N];

int main() {
    int n, m;
    cin >> n >> m;
    ll w[n];
    rep(i,n)cin >> w[i];
    rep(i,m){
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    int s; s = 1;
    s--;
    rep(i,n){
        x[i] = G[i].size();
        f[i] = -1;
    }


    rep(i,n){
        if(i == s)continue;
        if(x[i] == 1){
            f[i] = w[i];
            int t = i;
            x[i]--;
            while(true){
                int y;
                rep(j, G[t].size()){
                    if(f[G[t][j]] == -1){
                        y = G[t][j];
                        break;
                    }
                }

                if(y == s)break;

                if(x[y] == 2){
                    if(G[y].size() == 2){
                        x[y]--;
                        f[y] = f[t] + w[y];
                        t = y;
                        x[y]--;
                    }else{
                        x[y]--;
                        rep(j, G[y].size()){
                            f[y] = max(f[y], f[G[y][j]]);
                        }
                        f[y] = f[y] + w[y];
                        t = y;
                        x[y]--;
                    }
                }else if(x[y] > 2){
                    x[y]--;
                    break;
                }
            }
        }
    }




    ll ans = 0;

    rep(i,n){
        if(f[i] == -1){
            ans += w[i];
        }
    }

    ll tmp = 0;

    rep(i,n){
        tmp = max(f[i], tmp);
    }
    ans += tmp;

    cout << ans << endl;
    return 0;
}