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.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.Collection;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Queue;
import java.io.BufferedReader;
import java.util.LinkedList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int N = in.nextInt(), M = in.nextInt();
            GraphUtils graph = new GraphUtils();
            graph.initGraph(N, new String[N]);
            Integer score[] = in.nextIntArray(N);
            for (int i = 0; i < M; i++) {
                graph.addEdge(in.nextInt() - 1, in.nextInt() - 1, false, 1);
            }
            int source = in.nextInt() - 1;
            int degree[] = new int[N];
            Queue<GraphUtils.Node> queue = new LinkedList<>();
            for (GraphUtils.Node node : graph.nodes) {
                degree[node.index] = node.edges.size();
                if (node.index != source && degree[node.index] == 1) {
                    ((LinkedList<GraphUtils.Node>) queue).add(node);
                }
            }
            long best[] = new long[N];
            while (!queue.isEmpty()) {
                GraphUtils.Node node = queue.poll();
                degree[node.index] = -1;
                for (GraphUtils.Edge edge : node.edges) {
                    GraphUtils.Node v = edge.to;
                    if (degree[v.index] < 0) {
                        continue;
                    }
                    degree[v.index]--;
                    best[v.index] = Math.max(best[v.index], best[node.index] + score[node.index]);
                    if (degree[v.index] == 1 && v.index != source) {
                        ((LinkedList<GraphUtils.Node>) queue).add(v);
                    }
                }
            }
            long total = 0, maxInsert = 0;
            for (int i = 0; i < N; i++) {
                if (degree[i] < 0) {
                    continue;
                }
                total += score[i];
                maxInsert = Math.max(maxInsert, best[i]);
            }
            out.printLine(total + maxInsert);
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tokenizer = null;

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(in.readLine());
                }
                return tokenizer.nextToken();
            } catch (IOException e) {
                return null;
            }
        }

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

        public Integer[] nextIntArray(int size) {
            Integer array[] = new Integer[size];
            for (int i = 0; i < size; i++) {
                array[i] = nextInt();
            }
            return array;
        }

    }

    static class OutputWriter {
        PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }

    static class GraphUtils {
        GraphUtils.Node[] nodes;

        public void initGraph(int numberOfNodes, String labels[]) {
            nodes = new GraphUtils.Node[numberOfNodes];
            for (int i = 0; i < numberOfNodes; i++) {
                nodes[i] = new GraphUtils.Node();
                nodes[i].edges = new ArrayList<>();
                nodes[i].index = i;
                if (labels[i] != null) {
                    nodes[i].name = labels[i];
                }
            }
        }

        public void addEdge(int u, int v, boolean isDirected, long weight) {
            GraphUtils.Edge edge = new GraphUtils.Edge(nodes[u], nodes[v], weight);
            nodes[u].edges.add(edge);
            if (!isDirected) {
                GraphUtils.Edge edge1 = new GraphUtils.Edge(nodes[v], nodes[u], weight);
                nodes[v].edges.add(edge1);
            }
        }

        static class Node {
            String name;
            List<GraphUtils.Edge> edges;
            int index;

            public Node() {

            }

        }

        static class Edge {
            long weight;
            GraphUtils.Node from;
            GraphUtils.Node to;

            public Edge(GraphUtils.Node from, GraphUtils.Node to, long weight) {
                this.from = from;
                this.to = to;
                this.weight = weight;
            }

        }

    }
}

