#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
long long a[200002] = {};
long long b[200002] = {};
string s = "", ss = "";
long long n, m, k;
long long w;
long long ans;
long long mod = 1e9 + 7;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int t = 1;
  while (t--) {
    cin >> s;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    ;
    for (long long i = 0; i < n; i++) {
      a[i]--;
      b[a[i]]++;
      b[s.size() - a[i]]--;
    }
    for (long long i = 1; i < s.size() + 2; i++) b[i] += b[i - 1];
    int l = 0, r = s.size() - 1;
    while (l < r) {
      b[l] %= 2, b[r] %= 2;
      if (b[l] == b[r] && b[l]) swap(s[l], s[r]);
      l++;
      r--;
    }
    cout << s;
  }
  return 0;
}
