#include <bits/stdc++.h>
using namespace std;
map<char, int> m1;
void swap(char &x, char &y) {
  char temp = x;
  x = y;
  y = temp;
}
int main() {
  char s[300005];
  int arr[300005] = {0};
  scanf("%s", s);
  int n = strlen(s), m, i;
  scanf("%d", &m);
  while (m--) {
    int x;
    scanf("%d", &x);
    arr[x - 1]++;
  }
  int sum = 0;
  for (i = 0; i < (n + 1) / 2; i++) {
    sum += arr[i];
    if (sum & 1) {
      swap(s[i], s[n - i - 1]);
    } else {
      continue;
    }
  }
  printf("%s", s);
  return 0;
}
