#include <bits/stdc++.h>
using namespace std;
char s[200001];
int v[200002];
int main() {
  int n, m, i, j, a;
  char c;
  c = getchar();
  n = 0;
  while (c != '\n') {
    s[++n] = c;
    c = getchar();
  }
  scanf("%d", &m);
  for (i = 1; i <= m; i++) {
    scanf("%d", &a);
    v[a] += 1;
    v[n - a + 2] -= 1;
  }
  for (i = 1; i <= n; i++) v[i] += v[i - 1];
  char aux;
  for (i = 1; i <= n / 2; i++) {
    if (v[i] % 2 == 1) {
      aux = s[i];
      s[i] = s[n - i + 1];
      s[n - i + 1] = aux;
    }
  }
  for (i = 1; i <= n; i++) printf("%c", s[i]);
  return 0;
}
