#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long n;
  cin >> n;
  long long a[n];
  vector<long long> bb;
  bb.resize(s.size());
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum++;
    bb[a[i] - 1]++;
  }
  long long cnt = 0;
  for (long long i = 0; i < (s.size() / 2); i++) {
    if (bb[i] > 0) cnt += bb[i];
    if (bb[i] & 1)
      bb[i] = 1;
    else if (bb[i] == 0 && cnt)
      bb[i] = 1;
    else if (bb[i] != 0)
      bb[i] = 2;
    if (cnt & 1) swap(s[i], s[s.size() - i - 1]);
  }
  cout << s << endl;
  return 0;
}
