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>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <typename T1, typename T2>
inline void chkmin(T1 &first, T2 second) {
  if (first > second) first = second;
}
template <typename T1, typename T2>
inline void chkmax(T1 &first, T2 second) {
  if (first < second) first = second;
}
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const pair<T, U> &_p) {
  _out << _p.first << ' ' << _p.second;
  return _out;
}
template <typename T, typename U>
inline istream &operator>>(istream &_in, pair<T, U> &_p) {
  _in >> _p.first >> _p.second;
  return _in;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const vector<T> &_v) {
  if (_v.empty()) {
    return _out;
  }
  _out << _v.front();
  for (auto _it = ++_v.begin(); _it != _v.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline istream &operator>>(istream &_in, vector<T> &_v) {
  for (auto &_i : _v) {
    _in >> _i;
  }
  return _in;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const set<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const multiset<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const unordered_set<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const unordered_multiset<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const map<T, U> &_m) {
  if (_m.empty()) {
    return _out;
  }
  _out << '(' << _m.begin()->first << ": " << _m.begin()->second << ')';
  for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) {
    _out << ", (" << _it->first << ": " << _it->second << ')';
  }
  return _out;
}
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const unordered_map<T, U> &_m) {
  if (_m.empty()) {
    return _out;
  }
  _out << '(' << _m.begin()->first << ": " << _m.begin()->second << ')';
  for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) {
    _out << ", (" << _it->first << ": " << _it->second << ')';
  }
  return _out;
}
const int N = 3e5 + 5;
int n, m;
bool bad[N];
long long cost[N], w[N];
vector<int> edge[N];
long long ans = 0;
int px[N];
queue<int> dead;
long long mod = 0;
long long dfs(int i, int p = -1) {
  if (!bad[i]) return 0;
  long long ans = 0;
  for (int j : edge[i]) {
    if (j == p) continue;
    chkmax(ans, dfs(j, i));
  }
  return ans + w[i];
}
int s;
void dfs2(int i, int p = -1, long long sum = 0, long long need = 0) {
  if (!bad[i]) {
    vector<long long> best = {0};
    for (int j = 0; j < n; ++j) {
      if (bad[j]) continue;
      for (int q : edge[j]) {
        if (q == p || !bad[q]) continue;
        best.push_back(cost[q]);
      }
    }
    best.push_back(need);
    chkmax(ans, mod + sum + *max_element(best.begin(), best.end()));
    return;
    ;
  }
  sum += w[i];
  if (i == s) {
    need = cost[s] - w[s];
  }
  vector<long long> best;
  for (int q : edge[i]) {
    if (q == p || !bad[q]) continue;
    best.push_back(cost[q]);
  }
  sort(best.rbegin(), best.rend());
  chkmax(ans, sum);
  best.push_back(0);
  best.push_back(0);
  for (int j : edge[i]) {
    if (j == p) continue;
    if (best[0] == cost[j]) {
      dfs2(j, i, sum, max(need, best[1]));
    } else {
      dfs2(j, i, sum, max(need, best[0]));
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  srand(time(0));
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> w[i];
    mod += w[i];
    cost[i] = -1e18;
  }
  if (n == 1) {
    cout << w[0] << '\n';
    return 0;
  }
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  for (int i = 0; i < n; ++i) {
    px[i] = edge[i].size();
    if (px[i] == 1) {
      dead.push(i);
      px[i] = -1;
      bad[i] = true;
    }
  }
  cin >> s;
  --s;
  vector<long long> res;
  while (dead.size()) {
    int u = dead.front();
    mod -= w[u];
    dead.pop();
    vector<long long> best;
    for (int v : edge[u]) {
      if (bad[v]) {
        best.push_back(cost[v]);
      }
    }
    sort(best.rbegin(), best.rend());
    cost[u] = w[u];
    if (best.size()) {
      cost[u] += best[0];
    }
    res.push_back(cost[u]);
    chkmax(ans, cost[u]);
    for (int v : edge[u]) {
      --px[v];
      if (px[v] == 0 || px[v] == 1) {
        dead.push(v);
        px[v] = -1;
        bad[v] = true;
      }
    }
  }
  if (!bad[s]) {
    sort(res.rbegin(), res.rend());
    chkmax(ans, mod);
    if (res.size()) {
      chkmax(ans, mod + res[0]);
    }
    cout << ans << '\n';
    return 0;
  }
  dfs2(s);
  cout << ans << '\n';
}
