#include <bits/stdc++.h>
using namespace std;
int comp(int x, int y) { return x > y; }
int main() {
  string s;
  int i, n, m, l, j, t;
  cin >> s;
  char ch;
  l = s.size();
  int ar[300000] = {0};
  cin >> n;
  while (n--) {
    cin >> m;
    ar[m - 1]++;
  }
  t = 0;
  for (i = 0; i < (l / 2); i++) {
    t += ar[i];
    if (t % 2 == 1) {
      m = l - i - 1;
      swap(s[i], s[m]);
    }
  }
  cout << s << endl;
  return 0;
}
