#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, x, size;
  int freq[100001] = {};
  cin >> s >> n;
  size = s.length() - 1;
  for (int i = 0; i < n; i++) {
    cin >> x;
    freq[x - 1]++;
  }
  for (int i = 0; i <= size / 2; i++) {
    if (i) freq[i] += freq[i - 1];
  }
  for (int i = 0; i <= size / 2; i++) {
    if (freq[i] % 2 != 0) {
      char temp = s[i];
      s[i] = s[size - i];
      s[size - i] = temp;
    }
  }
  cout << s << endl;
  return 0;
}
