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.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.util.Comparator.*;

public class Main {
    FastScanner in;
    PrintWriter out;
    ArrayList<Integer>[] graph;
    ArrayList<GraphPair>[] weightedGraph;
    long mod = (long) 1e9 + 7; // 998_244_353L || (long) 1e9 + 9
    boolean multitests = false;

    private void solve() throws IOException {
        // solveA();
        // solveB();
        // solveC();
        // solveD();
        solveE();
        // solveF();
        // solveG();
        // solveH();
        // solveI();
        // solveJ();
        // solveK();
        // solveL();
    }

    private void solveA() throws IOException {
        int n = in.nextInt();
        int[] cnt = new int[2];
        for (char c : in.next().toCharArray())
            if (c == 'z')
                cnt[0]++;
            else if (c == 'o')
                cnt[1]++;
        cnt[1] -= cnt[0];
        for (int i = 1; i >= 0; i--) {
            while (cnt[i]-- > 0)
                out.print(i + " ");
        }
    }

    private void solveB() throws IOException {
        int n = in.nextInt();
        long[][] M = in.nextLongTable(n, n);
        long[] a = new long[n];
        a[0] = (long) sqrt(M[0][1] * M[0][2] / M[1][2]);
        while (a[0] * a[0] < M[0][1] * M[0][2] / M[1][2])
            a[0]++;
        while (a[0] * a[0] > M[0][1] * M[0][2] / M[1][2])
            a[0]--;
        out.print(a[0]);
        for (int i = 1; i < n; i++)
            out.print(" " + M[0][i] / a[0]);
    }

    private void solveC() throws IOException {
        int minChar = 'z';
        for (char c : in.next().toCharArray()) {
            out.println(minChar < c ? "Ann" : "Mike");
            minChar = min(minChar, c);
        }
    }

    private void solveD() throws IOException {
        int n = in.nextInt();
        long[] b = in.nextLongArray(n);
        int[] c = new int[n], cnt = new int[60];
        int maxId = 0;
        for (int i = 0; i < n; i++) {
            while (b[i] % (1L << c[i]) == 0)
                c[i]++;
            c[i]--;
            if (++cnt[c[i]] > cnt[maxId])
                maxId = c[i];
        }
        out.println(n - cnt[maxId]);
        for (int i = 0; i < n; i++) {
            if (c[i] != maxId)
                out.print(b[i] + " ");
        }
    }

    private void solveE() throws IOException {
        int n = in.nextInt(), m = in.nextInt();
        long[] w = in.nextLongArray(n);
        long sumW = sumLong(w);
        graph = in.nextGraph(n, m, false);
        int s = in.nextInt() - 1;
        long[] maxAdd = new long[n];
        boolean[] deleted = new boolean[n];
        int[] cnt = new int[n];
        int[] q = new int[n];
        int ql = 0, qr = 0;
        for (int v = 0; v < n; v++) {
            if ((cnt[v] = graph[v].size()) == 1 && v != s) {
                q[qr++] = v;
            }
        }
        while (ql < qr) {
            int v = q[ql++];
            sumW -= w[v];
            deleted[v] = true;
            int cntr = 0;
            for (int u : graph[v]) {
                if (!deleted[u]) {
                    cntr++;
                    maxAdd[u] = max(maxAdd[u], maxAdd[v] + w[v]);
                    if (--cnt[u] == 1 && u != s) {
                        q[qr++] = u;
                    }
                }
            }
            if (cntr != 1)
                n = 1 / 0;
        }
        long cur = 0, ans = 0;
        for (int v = 0; v < n; v++) {
            if (!deleted[v])
                ans = max(ans, cur + sumW + maxAdd[v]);
        }
        out.println(ans);
    }

    private void solveF() throws IOException {

    }

    private void solveG() throws IOException {

    }

    private void solveH() throws IOException {

    }

    private void solveI() throws IOException {

    }

    private void solveJ() throws IOException {

    }

    private void solveK() throws IOException {

    }

    private void solveL() throws IOException {

    }

    void shuffleInt(int[] a) {
        Random random = new Random();
        for (int i = a.length - 1; i > 0; i--) {
            int j = random.nextInt(i + 1);
            int swap = a[j];
            a[j] = a[i];
            a[i] = swap;
        }
    }

    void shuffleLong(long[] a) {
        Random random = new Random();
        for (int i = a.length - 1; i > 0; i--) {
            int j = random.nextInt(i + 1);
            long swap = a[j];
            a[j] = a[i];
            a[i] = swap;
        }
    }

    void reverseInt(int[] a) {
        for (int i = 0, j = a.length - 1; i < j; i++, j--) {
            int swap = a[i];
            a[i] = a[j];
            a[j] = swap;
        }
    }

    void reverseLong(long[] a) {
        for (int i = 0, j = a.length - 1; i < j; i++, j--) {
            long swap = a[i];
            a[i] = a[j];
            a[j] = swap;
        }
    }

    int maxInt(int[] a) {
        int max = a[0];
        for (int i = 1; i < a.length; i++)
            if (max < a[i])
                max = a[i];
        return max;
    }

    long maxLong(long[] a) {
        long max = a[0];
        for (int i = 1; i < a.length; i++)
            if (max < a[i])
                max = a[i];
        return max;
    }

    int minInt(int[] a) {
        int min = a[0];
        for (int i = 1; i < a.length; i++)
            if (min > a[i])
                min = a[i];
        return min;
    }

    long minLong(long[] a) {
        long min = a[0];
        for (int i = 1; i < a.length; i++)
            if (min > a[i])
                min = a[i];
        return min;
    }

    long sumInt(int[] a) {
        long s = 0;
        for (int i = 0; i < a.length; i++)
            s += a[i];
        return s;
    }

    long sumLong(long[] a) {
        long s = 0;
        for (int i = 0; i < a.length; i++)
            s += a[i];
        return s;
    }

    long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    long binpowmod(long a, long n) {
        long res = 1;
        a %= mod;
        n %= mod - 1;
        while (n > 0) {
            if (n % 2 == 1)
                res = (res * a) % mod;
            a = (a * a) % mod;
            n /= 2;
        }
        return res;
    }

    class GraphPair implements Comparable<GraphPair> {
        int v;
        long w;

        GraphPair(int v, long w) {
            this.v = v;
            this.w = w;
        }

        public int compareTo(GraphPair o) {
            return w != o.w ? Long.compare(w, o.w) : Integer.compare(v, o.v);
        }
    }

    ArrayList<Integer>[] createGraph(int n) throws IOException {
        ArrayList<Integer>[] graph = new ArrayList[n];
        for (int i = 0; i < n; i++)
            graph[i] = new ArrayList<>();
        return graph;
    }

    ArrayList<GraphPair>[] createWeightedGraph(int n) throws IOException {
        ArrayList<GraphPair>[] graph = new ArrayList[n];
        for (int i = 0; i < n; i++)
            graph[i] = new ArrayList<>();
        return graph;
    }

    class FastScanner {
        StringTokenizer st;
        BufferedReader br;

        FastScanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s), 32768);
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        boolean hasNext() throws IOException {
            return br.ready() || (st != null && st.hasMoreTokens());
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) throws IOException {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = in.nextInt();
            return a;
        }

        int[][] nextIntTable(int n, int m) throws IOException {
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    a[i][j] = in.nextInt();
            return a;
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        long[] nextLongArray(int n) throws IOException {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = in.nextLong();
            return a;
        }

        long[][] nextLongTable(int n, int m) throws IOException {
            long[][] a = new long[n][m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    a[i][j] = in.nextLong();
            return a;
        }

        ArrayList<Integer>[] nextGraph(int n, int m, boolean directed) throws IOException {
            ArrayList<Integer>[] graph = createGraph(n);
            for (int i = 0; i < m; i++) {
                int v = in.nextInt() - 1, u = in.nextInt() - 1;
                graph[v].add(u);
                if (!directed)
                    graph[u].add(v);
            }
            return graph;
        }

        ArrayList<GraphPair>[] nextWeightedGraph(int n, int m, boolean directed) throws IOException {
            ArrayList<GraphPair>[] graph = createWeightedGraph(n);
            for (int i = 0; i < m; i++) {
                int v = in.nextInt() - 1, u = in.nextInt() - 1;
                long w = in.nextLong();
                graph[v].add(new GraphPair(u, w));
                if (!directed)
                    graph[u].add(new GraphPair(v, w));
            }
            return graph;
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }

        boolean hasNextLine() throws IOException {
            return br.ready();
        }
    }

    private void run() throws IOException {
        in = new FastScanner(System.in); // new FastScanner(new FileInputStream(".in"));
        out = new PrintWriter(System.out); // new PrintWriter(new FileOutputStream(".out"));

        for (int t = multitests ? in.nextInt() : 1; t-- > 0; )
            solve();

        out.flush();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}