#include <bits/stdc++.h>
using namespace std;
char A[200005];
int B[100005], C[100005];
int n, a, len, t, sayac;
int main() {
  scanf("%s", A);
  scanf("%d", &n);
  len = strlen(A);
  if (n == 1) {
    scanf("%d", &a);
    for (int i = a - 1; i < len / 2; i++) {
      t = A[i];
      A[i] = A[len - 1 - i];
      A[len - 1 - i] = t;
    }
    printf("%s", A);
    return 0;
  }
  for (int i = 0; i < n; i++) scanf("%d", &C[i]);
  sort(C, C + n);
  for (int i = 0; i < n; i += 2) {
    if (C[i + 1] == 0) C[i + 1] = len / 2 + 1;
    for (int j = C[i] - 1; j < C[i + 1] - 1; j++) B[j] = 1;
  }
  for (int i = 0; i < len / 2; i++) {
    if (B[i] % 2 == 1) {
      t = A[i];
      A[i] = A[len - 1 - i];
      A[len - 1 - i] = t;
    }
  }
  printf("%s", A);
  return 0;
}
