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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;
import java.io.IOException;
import java.util.Deque;
import java.util.ArrayList;
import java.io.UncheckedIOException;
import java.util.List;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.ArrayDeque;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            TaskE solver = new TaskE();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class TaskE {
        int dfn = 1;
        Deque<Node> stack = new ArrayDeque<>();

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            int m = in.readInt();
            Node[] nodes = new Node[n + 1];
            for (int i = 1; i <= n; i++) {
                nodes[i] = new Node();
                nodes[i].id = i;
                nodes[i].w = in.readInt();
            }

            for (int i = 0; i < m; i++) {
                Node a = nodes[in.readInt()];
                Node b = nodes[in.readInt()];
                a.next.add(b);
                b.next.add(a);
            }

            for (int i = 1; i <= n; i++) {
                tarjan(nodes[i], null);
            }

            Node root = nodes[in.readInt()].set;
            dfs(root);
            out.println(root.dp[0]);
        }

        void dfs(Node root) {
            root.visited = true;
            for (Node node : root.next) {
                node = node.set;
                if (node.visited) {
                    continue;
                }
                dfs(node);
                root.dp[0] = Math.max(node.dp[0] - node.dp[1], root.dp[0]);
                root.dp[1] += node.dp[1];
                root.meet = root.meet || node.meet;
            }
            root.dp[0] += root.dp[1] + root.w;
            root.meet = root.meet || root.size > 1;
            if (root.meet) {
                root.dp[1] += root.w;
            }
        }

        void tarjan(Node root, Node father) {
            if (root.dfn != 0) {
                return;
            }
            root.low = root.dfn = dfn++;
            root.instk = true;
            stack.addLast(root);
            for (Node node : root.next) {
                if (node == father) {
                    continue;
                }
                tarjan(node, root);
                if (node.instk) {
                    root.low = Math.min(root.low, node.low);
                }
            }
            if (root.low == root.dfn) {
                while (true) {
                    Node last = stack.removeLast();
                    last.set = root;
                    last.instk = false;
                    if (last == root) {
                        break;
                    }
                    root.w += last.w;
                    root.size++;
                    root.next = CollectionUtils.mergeHeuristically(root.next, last.next);
                }
            }
        }

    }

    static class Node {
        List<Node> next = new ArrayList<>();
        Node set;
        int dfn = 0;
        int low;
        boolean instk = false;
        long w;
        long[] dp = new long[2];
        boolean meet;
        boolean visited;
        int size = 1;
        int id;

        public String toString() {
            return "" + id;
        }

    }

    static class FastOutput implements AutoCloseable, Closeable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput println(long c) {
            cache.append(c).append('\n');
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class CollectionUtils {
        public static <E, T extends Collection<E>> T mergeHeuristically(T a, T b) {
            if (a.size() >= b.size()) {
                a.addAll(b);
                return a;
            } else {
                b.addAll(a);
                return b;
            }
        }

    }
}

