#include <bits/stdc++.h>
using namespace std;
char s[222222], t[222222];
int A[222222];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  int m, a;
  cin >> m;
  while (m--) {
    cin >> a;
    A[a]++;
    A[n - a + 2]--;
  }
  for (int i = 1; i <= n; i++) {
    t[i] = s[n - i + 1];
  }
  for (int i = 1; i <= n; i++) {
    A[i] += A[i - 1];
    if (A[i] % 2) {
      cout << t[i];
    } else {
      cout << s[i];
    }
  }
  cout << endl;
  return 0;
}
