#include <bits/stdc++.h>
using namespace std;
const int S = 2e5 + 5, M = 2e5 + 5;
int days[M];
char s[S];
int m;
int main() {
  scanf("%s %d", s, &m);
  int len = strlen(s);
  int temp;
  for (int i = 0; i < m; ++i) {
    scanf("%d", &temp);
    ++days[temp];
  }
  for (int i = 1; i <= len / 2; ++i) {
    days[i] += days[i - 1];
    days[len - i + 1] = days[i];
  }
  for (int i = 0; i < len; ++i) {
    if (days[i + 1] & 1) {
      printf("%c", s[len - i - 1]);
      continue;
    }
    printf("%c", s[i]);
  }
}
