#include <bits/stdc++.h>
using namespace std;
int swap(char &a, char &b) {
  char t = a;
  a = b;
  b = t;
  return 0;
}
int main() {
  char a[200001];
  int m, n, na = 0, s = 0, t;
  unsigned char b[200000] = {0};
  cin >> a >> m;
  for (int i = 0; i < m; i++) {
    cin >> t;
    b[t - 1] = 1 - b[t - 1];
  }
  while (a[na]) na++;
  for (int i = 0; i <= (na - 1) / 2; i++) {
    s += b[i];
    if (s % 2 != 0) swap(a[i], a[na - i - 1]);
  }
  cout << a << endl;
  return 0;
}
