#include <bits/stdc++.h>
using namespace std;
long long mod = 1;
int n, m, x, y, u, v;
int l, r;
int ar[200005];
int cnt[200005];
bool rev, f[200005];
string s;
char ans[200005];
set<int> st;
set<int>::iterator it;
int mn = INT_MAX;
int main() {
  int i, j, t, tc = 1, a, b;
  cin >> s;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &ar[i]);
    mn = min(mn, ar[i]);
    cnt[ar[i]]++;
    st.insert(ar[i]);
  }
  int len = s.length();
  int k = 0;
  for (it = st.begin(); it != st.end(); it++) {
    ar[k++] = *it;
  }
  x = k;
  k = 0;
  for (i = 0; i <= (s.length()) / 2; i++) {
    if (i == ar[k] - 1) {
      if (cnt[ar[k]] % 2 == 1) {
        if (!rev) {
          l = ar[k] - 1;
          r = len - ar[k];
          ans[l] = s[r];
          ans[r] = s[l];
          f[l] = 1;
          f[r] = 1;
          rev = 1;
        } else {
          l = ar[k] - 1;
          r = (len - ar[k]);
          ans[l] = s[l];
          ans[r] = s[r];
          rev = 0;
          f[l] = 1;
          f[r] = 1;
        }
      } else {
        if (!rev) {
          l = ar[k] - 1;
          r = (len - ar[k]);
          ans[l] = s[l];
          ans[r] = s[r];
          rev = 0;
          f[l] = 1;
          f[r] = 1;
        } else {
          l = ar[k] - 1;
          r = (len - ar[k]);
          ans[l] = s[r];
          ans[r] = s[l];
          rev = 1;
          f[l] = 1;
          f[r] = 1;
        }
      }
      k = k + 1;
    } else {
      int now = len - mn;
      if (i < mn - 1) {
        ans[i] = s[i];
        f[i] = 1;
        x = len - (i + 1);
        ans[x] = s[x];
        f[x] = 1;
      } else if (i >= now + 1) {
        ans[i] = s[i];
        f[i] = 1;
        x = len - (i + 1);
        ans[x] = s[x];
        f[x] = 1;
      } else {
        if (rev && !f[i] && !f[len - (i + 1)]) {
          ans[i] = s[len - (i + 1)];
          ans[len - (i + 1)] = s[i];
          f[i] = 1;
          f[len - (i + 1)] = 1;
        } else if (!rev && !f[i] && !f[len - (i + 1)]) {
          ans[i] = s[i];
          ans[len - (i + 1)] = s[len - (i + 1)];
          f[i] = 1;
          f[len - (i + 1)] = 1;
        }
      }
    }
  }
  for (i = 0; i < s.length(); i++) cout << ans[i];
  return 0;
}
