#include <bits/stdc++.h>
using namespace std;
int t, n, m;
vector<int> kkk(1000000);
vector<int>::iterator it;
char s[10000000], kakka[10000000];
int main() {
  scanf("%s", s);
  int l = strlen(s);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &kkk[i]);
  }
  sort(kkk.begin(), kkk.begin() + n);
  int p = 0;
  for (int i = 0; i < l / 2; i++) {
    it = upper_bound(kkk.begin(), kkk.begin() + n, i + 1);
    if (it != kkk.end()) {
      int k = it - kkk.begin();
      p = k;
      if (k % 2 == 0) {
        kakka[i] = s[i];
        kakka[l - i - 1] = s[l - i - 1];
      }
      if (k % 2 == 1) {
        kakka[i] = s[l - i - 1];
        kakka[l - i - 1] = s[i];
      }
    } else {
      int k = p;
      if (k % 2 == 0) {
        kakka[i] = s[i];
        kakka[l - i - 1] = s[l - i - 1];
      }
      if (k % 2 == 1) {
        kakka[i] = s[l - i - 1];
        kakka[l - i - 1] = s[i];
      }
    }
  }
  for (int i = 0; i < l; i++) {
    if (l % 2 == 1 && i == l / 2)
      printf("%c", s[i]);
    else
      printf("%c", kakka[i]);
  }
  return 0;
}
