Alex decided to go on a touristic trip over the country.

For simplicity let's assume that the country has n cities and m bidirectional roads connecting them. Alex lives in city s and initially located in it. To compare different cities Alex assigned each city a score w_i which is as high as interesting city seems to Alex.

Alex believes that his trip will be interesting only if he will not use any road twice in a row. That is if Alex came to city v from city u, he may choose as the next city in the trip any city connected with v by the road, except for the city u.

Your task is to help Alex plan his city in a way that maximizes total score over all cities he visited. Note that for each city its score is counted at most once, even if Alex been there several times during his trip.

Input

First line of input contains two integers n and m, (1 ≤ n ≤ 2 ⋅ 10^5, 0 ≤ m ≤ 2 ⋅ 10^5) which are numbers of cities and roads in the country.

Second line contains n integers w_1, w_2, …, w_n (0 ≤ w_i ≤ 10^9) which are scores of all cities.

The following m lines contain description of the roads. Each of these m lines contains two integers u and v (1 ≤ u, v ≤ n) which are cities connected by this road.

It is guaranteed that there is at most one direct road between any two cities, no city is connected to itself by the road and, finally, it is possible to go from any city to any other one using only roads.

The last line contains single integer s (1 ≤ s ≤ n), which is the number of the initial city.

Output

Output single integer which is the maximum possible sum of scores of visited cities.

Examples

Input


5 7
2 2 8 6 9
1 2
1 3
2 4
3 2
4 5
2 5
1 5
2


Output


27


Input


10 12
1 7 1 9 3 3 6 30 1 10
1 2
1 3
3 5
5 7
2 3
5 4
6 9
4 6
3 7
6 8
9 4
9 10
6


Output


61
import java.util.*;
import java.io.*;
import java.text.*;
public class Main{
    //SOLUTION BEGIN
    //Into the Hardware Mode
    void pre()throws Exception{}
    void solve(int TC)throws Exception{
        int n = ni(), m = ni();
        long[] w = new long[n];
        for(int i = 0; i< n; i++)w[i] = nl();
        int[][] e = new int[m][];
        for(int i = 0; i< m; i++)e[i] = new int[]{ni()-1, ni()-1, i};
        int s = ni()-1;
        int[][][] g = makeUS(n, e);
        boolean[] bridge = bridge(g, m);
        int[][] set = new int[2][n];
        for(int i = 0; i< n; i++){
            set[0][i] = i;
            set[1][i] = 1;
        }
        for(int i = 0; i< m; i++)if(!bridge[i]){
            int u = find(set, e[i][0]), v = find(set, e[i][1]);
            set[1][u] += set[1][v];
            set[0][v] = u;
        }
        
        int cnt = 0;
        for(int i = 0; i< n; i++)if(set[0][find(set, i)] == i)cnt++;
        boolean[] sp = new boolean[cnt];
        long[] wc = new long[cnt];
        int[] mp = new int[n];
        Arrays.fill(mp, -1);
        int ind = 0;
        for(int i = 0; i< n; i++){
            if(set[0][i] != i)continue;
            mp[i] = ind++;
            if(set[1][i] > 1)sp[mp[i]] = true;
        }
        for(int i = 0; i< n; i++)wc[mp[find(set, i)]]+= w[i];
        int[][] ee = new int[m][];int c = 0;
        for(int i= 0; i< m; i++)if(bridge[i])ee[c++] = new int[]{mp[find(set, e[i][0])], mp[find(set, e[i][1])]};
        ee = Arrays.copyOfRange(ee, 0, c);
        int root = mp[find(set, s)];
        int[][] gg = makeU(cnt, ee);
        
        long[] ans = dfs(gg, sp, wc, root, -1);
        pn(ans[0]);
    }
    long[] dfs(int[][] g, boolean[] sp, long[] w, int u, int p){
        
        long[] ret = new long[2];
        
        long mx = 0;
        for(int v:g[u]){
            if(v == p)continue;
            long[] val = dfs(g, sp, w, v, u);
            mx = Math.max(mx, val[0]-val[1]);
            ret[1] += val[1];
            sp[u] |= sp[v];
        }
        ret[0] = ret[1]+mx;
        ret[0] += w[u];
        if(sp[u])ret[1] += w[u];
        return ret;
    }
    
    int find(int[][] set, int u){return set[0][u] = (set[0][u] == u?u:find(set, set[0][u]));}
    int[][] makeU(int n, int[][] edge){
        int[][] g = new int[n][];int[] cnt = new int[n];
        for(int i = 0; i< edge.length; i++){cnt[edge[i][0]]++;cnt[edge[i][1]]++;}
        for(int i = 0; i< n; i++)g[i] = new int[cnt[i]];
        for(int i = 0; i< edge.length; i++){
            g[edge[i][0]][--cnt[edge[i][0]]] = edge[i][1];
            g[edge[i][1]][--cnt[edge[i][1]]] = edge[i][0];
        }
        return g;
    }
    int[][][] makeUS(int n, int[][] edge){
        int[][][] g = new int[n][][];int[] cnt = new int[n];
        for(int i = 0; i< edge.length; i++){cnt[edge[i][0]]++;cnt[edge[i][1]]++;}
        for(int i = 0; i< n; i++)g[i] = new int[cnt[i]][];
        for(int i = 0; i< edge.length; i++){
            g[edge[i][0]][--cnt[edge[i][0]]] = new int[]{edge[i][1], edge[i][2]};
            g[edge[i][1]][--cnt[edge[i][1]]] = new int[]{edge[i][0], edge[i][2]};
        }
        return g;
    }
    boolean[] bridge(int[][][] g, int m){
        int n = g.length;
        boolean[] vis = new boolean[n], ans = new boolean[m];
        int[] disc=  new int[n], low = new int[n];
        Arrays.fill(low, INF);  
        for(int i = 0; i< n; i++)if(!vis[i] && g[i]!=null)bridgeUtil(g, ans, vis, disc, low, i, -1, 0);
        return ans;
    }
    
    void bridgeUtil(int[][][] g, boolean[] ans, boolean[] vis, int[] disc, int[] low, int u, int p, int t){
        vis[u] = true;
        disc[u] = low[u] = ++t;
        for(int[] v:g[u]){
            if(!vis[v[0]]){
                bridgeUtil(g,ans,vis,disc,low,v[0],u,t);
                low[u] = Math.min(low[u], low[v[0]]);
                if(low[v[0]]>disc[u])ans[v[1]] = true;
            }else if(p!=v[0])low[u] = Math.min(low[u], disc[v[0]]);
        }
    }
    //SOLUTION END
    void hold(boolean b)throws Exception{if(!b)throw new Exception("Hold right there, Sparky!");}
    void exit(boolean b){if(!b)System.exit(0);}
    long IINF = (long)1e18;
    final int INF = (int)1e9, MX = (int)2e6+5;
    DecimalFormat df = new DecimalFormat("0.00000000");
    double PI = 3.141592653589793238462643383279502884197169399, eps = 1e-6;
    static boolean multipleTC = false, memory = false, fileIO = false;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        if(fileIO){
            in = new FastReader("input.txt");
            out = new PrintWriter("output.txt");
        }else {
            in = new FastReader();
            out = new PrintWriter(System.out);
        }
        //Solution Credits: Taranpreet Singh
        int T = (multipleTC)?ni():1;
        pre();
        for(int t = 1; t<= T; t++)solve(t);
        out.flush();
        out.close();
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start();
        else new Main().run();
    }

    int digit(long s){int ans = 0;while(s>0){s/=10;ans++;}return ans;}
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object o){out.println(o);}
    void pni(Object o){out.println(o);out.flush();}
    String n()throws Exception{return in.next();}
    String nln()throws Exception{return in.nextLine();}
    int ni()throws Exception{return Integer.parseInt(in.next());}
    long nl()throws Exception{return Long.parseLong(in.next());}
    double nd()throws Exception{return Double.parseDouble(in.next());}

    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

        String next() throws Exception{
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    throw new Exception(e.toString());
                }
            }
            return st.nextToken();
        }

        String nextLine() throws Exception{
            String str = "";
            try{   
                str = br.readLine();
            }catch (IOException e){
                throw new Exception(e.toString());
            }  
            return str;
        }
    }
}

