#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 10;
char s[MAX];
int n, sl[MAX];
int main() {
  gets(s + 1);
  s[0] = ' ';
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int val;
    scanf("%d", &val);
    ++sl[val];
  }
  int m = strlen(s) - 1;
  for (int i = 1; i <= (m >> 1); ++i) {
    sl[i] += sl[i - 1];
    if (sl[i] & 1) swap(s[i], s[m - i + 1]);
  }
  for (int i = 1; i <= m; ++i) putchar(s[i]);
  return 0;
}
