#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int arr[200009], tin[200009], fup[200009], TIM, comp[200009], S;
stack<int> st;
int sz[200009], who[200009];
vector<int> adj[200009];
void dfs(int nd, int pr) {
  st.push(nd);
  tin[nd] = fup[nd] = ++TIM;
  for (int i = 0; i < int(adj[nd].size()); i++) {
    int to = adj[nd][i];
    if (to == pr) continue;
    if (!tin[to]) {
      dfs(to, nd);
      umin(fup[nd], fup[to]);
    } else
      umin(fup[nd], tin[to]);
  }
  if (fup[nd] == tin[nd]) {
    int aux;
    S++;
    do {
      aux = st.top();
      st.pop();
      comp[aux] = S;
      who[S] = aux;
      sz[S]++;
    } while (aux != nd);
  }
}
int deg[200009];
set<int> s[200009];
long long dp[200009];
int main() {
  int n, m, st;
  scanf("%d%d", &n, &m);
  long long ans = 0;
  for (int i = 1; i <= n; i++) scanf("%d", arr + i), ans += arr[i];
  vector<pair<int, int> > edge;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
    edge.push_back(make_pair(u, v));
  }
  scanf("%d", &st);
  dfs(1, -1);
  for (__typeof((edge).begin()) it = (edge).begin(); it != (edge).end(); it++) {
    int u = comp[it->first], v = comp[it->second];
    if (u == v) continue;
    s[u].insert(v);
    s[v].insert(u);
  }
  queue<int> q;
  for (int i = 1; i <= S; i++)
    if (sz[i] == 1 and s[i].size() == 1 and who[i] != st) q.push(i);
  long long mx = 0;
  while (!q.empty()) {
    int nd = q.front();
    q.pop();
    dp[nd] += arr[who[nd]];
    umax(mx, dp[nd]);
    ans -= arr[who[nd]];
    int to = *s[nd].begin();
    if (sz[to] != 1 or who[to] == st) continue;
    s[to].erase(nd);
    umax(dp[to], dp[nd]);
    if (s[to].size() == 1) q.push(to);
  }
  printf("%lld\n", ans + mx);
  return 0;
}
