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
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 5e5 + 50;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const long long MOD = 1e9 + 7;
const double EPS = 1e-6;
const double Pi = acos(-1);
void test() { cerr << "\n"; }
template <typename T, typename... Args>
void test(T x, Args... args) {
  cerr << x << " ";
  test(args...);
}
long long qpow(long long a, long long b) {
  return b ? ((b & 1) ? a * qpow(a * a % MOD, b >> 1) % MOD
                      : qpow(a * a % MOD, b >> 1)) %
                 MOD
           : 1;
}
long long qpow(long long a, long long b, long long c) {
  return b ? ((b & 1) ? a * qpow(a * a % c, b >> 1) % c
                      : qpow(a * a % c, b >> 1)) %
                 c
           : 1;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int sign(double x) { return x < -EPS ? -1 : x > EPS; }
int dbcmp(double l, double r) { return sign(l - r); }
const int MAXG = 2e5 + 50;
struct Edge {
  int from, to;
  long long cost;
  int nxt;
};
struct Graph {
  struct Edge E[MAXG * 5];
  int cntE, head[MAXG];
  void init(int n = MAXG - 10) {
    if (n > MAXG / 2)
      memset(head, -1, sizeof(head));
    else
      for (int i = 0; i < n + 9; i++) head[i] = -1;
    cntE = 0;
  }
  void addE(int a, int b, long long c = 0) {
    E[cntE] = {a, b, c, head[a]};
    head[a] = cntE++;
  }
};
struct Dijkstra : Graph {
  long long dist[MAXG];
  struct DNode {
    long long val;
    int id;
    bool operator<(const DNode& r) const { return val > r.val; }
  };
  void Init(int n = MAXG - 100) {
    n *= 2;
    if (n > MAXG / 2)
      memset(dist, 0x3f, sizeof(dist));
    else
      for (int i = 0; i < n + 9; i++) dist[i] = 0x3f3f3f3f;
  }
  void Get_Dist(int s) {
    Init();
    priority_queue<DNode> pq;
    pq.push({0, s});
    dist[s] = 0;
    while (!pq.empty()) {
      DNode tmp = pq.top();
      pq.pop();
      if (tmp.val > dist[tmp.id]) continue;
      for (int i = head[tmp.id]; i != -1; i = E[i].nxt) {
        if (dist[E[i].to] > dist[tmp.id] + E[i].cost) {
          dist[E[i].to] = dist[tmp.id] + E[i].cost;
          pq.push({dist[E[i].to], E[i].to});
        }
      }
    }
  }
  int Get_Dist(int s, int t) {
    if (dist[t] == 0x3f3f3f3f && dist[s] != 0) Get_Dist(s);
    return dist[t];
  }
};
struct Dinic : Graph {
  int curE[MAXG], s, t, dist[MAXG];
  long long dfs(int u, long long f) {
    if (u == t) return f;
    long long ans = 0;
    for (int& i = curE[u]; i != -1; i = E[i].nxt) {
      if (dist[E[i].to] == dist[u] + 1 && E[i].cost > 0) {
        long long tmp = dfs(E[i].to, min(f, E[i].cost));
        f -= tmp;
        E[i].cost -= tmp;
        ans += tmp;
        E[i ^ 1].cost += tmp;
        if (!f) break;
      }
    }
    if (!ans) dist[u] = -1;
    return ans;
  }
  bool bfs(int n) {
    if (n > MAXG / 2)
      memset(dist, -1, sizeof(dist));
    else
      for (int i = 0; i < n + 9; i++) dist[i] = -1;
    queue<int> q;
    q.push(s);
    dist[s] = 0;
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      for (int i = head[u]; i != -1; i = E[i].nxt) {
        if (dist[E[i].to] == -1 && E[i].cost > 0) {
          dist[E[i].to] = dist[u] + 1;
          q.push(E[i].to);
        }
      }
    }
    return dist[t] != -1;
  }
  long long dinic(int x, int y, int n) {
    s = x;
    t = y;
    long long ans = 0;
    while (bfs(n)) {
      for (int i = 0; i <= n; i++) curE[i] = head[i];
      ans += dfs(s, INF);
    }
    return ans;
  }
};
struct SCC : Graph {
  int DFN[MAXG], LOW[MAXG], tim, stk[MAXG], stktop, Scc[MAXG], Scc_Cnt;
  bool in_stk[MAXG];
  void Init(int n = MAXG - 10) {
    init(n);
    Scc_Cnt = tim = stktop = 0;
    if (n > MAXG / 2)
      memset(DFN, 0, sizeof(DFN)), memset(Scc, 0, sizeof(Scc)),
          memset(LOW, 0, sizeof(LOW)), memset(in_stk, 0, sizeof(in_stk));
    else
      for (int i = 0; i < n + 9; i++) DFN[i] = LOW[i] = Scc[i] = in_stk[i] = 0;
  }
  void dfs(int u) {
    DFN[u] = LOW[u] = ++tim;
    stk[++stktop] = u;
    in_stk[u] = 1;
    for (int i = head[u]; i != -1; i = E[i].nxt) {
      if (!DFN[E[i].to]) {
        dfs(E[i].to);
        LOW[u] = min(LOW[u], LOW[E[i].to]);
      } else if (in_stk[E[i].to])
        LOW[u] = min(LOW[u], LOW[E[i].to]);
    }
    if (DFN[u] == LOW[u]) {
      int x;
      Scc_Cnt++;
      do {
        x = stk[stktop--];
        in_stk[x] = 0;
        Scc[x] = Scc_Cnt;
      } while (x != u);
    }
  }
};
struct BCC : Graph {
  int DFN[MAXG], LOW[MAXG], tim, stk[MAXG], stktop, Bcc[MAXG], Bcc_Cnt;
  bool in_stk[MAXG];
  long long wi[MAXG], totw[MAXG];
  int totc[MAXG];
  void Init(int n = MAXG - 10) {
    init(n);
    Bcc_Cnt = tim = stktop = 0;
    if (n > MAXG / 2)
      memset(DFN, 0, sizeof(DFN)), memset(Bcc, 0, sizeof(Bcc)),
          memset(LOW, 0, sizeof(LOW)), memset(in_stk, 0, sizeof(in_stk));
    else
      for (int i = 0; i < n + 9; i++) DFN[i] = LOW[i] = Bcc[i] = in_stk[i] = 0;
  }
  void dfs(int u, int fa = -1) {
    DFN[u] = LOW[u] = ++tim;
    stk[++stktop] = u;
    in_stk[u] = 1;
    for (int i = head[u]; i != -1; i = E[i].nxt) {
      if ((i ^ 1) == fa) continue;
      if (!DFN[E[i].to]) {
        dfs(E[i].to, i);
        LOW[u] = min(LOW[u], LOW[E[i].to]);
        if (LOW[E[i].to] > DFN[u]) {
          E[i].cost = 1;
          E[i ^ 1].cost = 1;
        }
      } else if (DFN[E[i].to] < DFN[u])
        LOW[u] = min(LOW[u], DFN[E[i].to]);
    }
    if (DFN[u] == LOW[u]) {
      int x;
      Bcc_Cnt++;
      do {
        x = stk[stktop--];
        in_stk[x] = 0;
        Bcc[x] = Bcc_Cnt;
        totw[Bcc_Cnt] += wi[x];
        totc[Bcc_Cnt]++;
      } while (x != u);
    }
  }
  void rebuild() {
    int all = cntE;
    cntE = 0;
    memset(head, -1, sizeof(head));
    for (int i = 0; i < all; i += 2) {
      if (Bcc[E[i].from] != Bcc[E[i].to]) {
        int x = Bcc[E[i].from], y = Bcc[E[i].to];
        addE(x, y);
        addE(y, x);
      }
    }
  }
  bool xx[MAXG];
  long long maxv[MAXG], ansx[MAXG];
  void dfs2(int u, int fa = -1) {
    if (totc[u] >= 2) xx[u] = 1;
    for (int enow = head[u]; enow != -1; enow = E[enow].nxt) {
      int v = E[enow].to;
      if (v != fa) {
        dfs2(v, u);
        xx[u] |= xx[v];
        maxv[u] = max(maxv[u], maxv[v]);
        ansx[u] += ansx[v];
      }
    }
    if (xx[u])
      ansx[u] += totw[u];
    else
      maxv[u] += totw[u];
  }
} Bcc;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  Bcc.Init();
  for (int i = 1; i <= n; i++) {
    scanf("%d", &Bcc.wi[i]);
  }
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    Bcc.addE(a, b);
    Bcc.addE(b, a);
  }
  int s;
  scanf("%d", &s);
  Bcc.dfs(s);
  Bcc.rebuild();
  Bcc.dfs2(Bcc.Bcc[s]);
  printf("%lld\n", Bcc.ansx[Bcc.Bcc[s]] + Bcc.maxv[Bcc.Bcc[s]]);
}
