#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  string s;
  cin >> s;
  int m;
  cin >> m;
  int temp[s.length() + 5];
  memset(temp, 0, sizeof(temp));
  int len = s.length();
  for (int i = 0; i < m; i++) {
    int ai;
    cin >> ai;
    temp[ai - 1]++;
  }
  int half = len / 2;
  if (len % 2 == 0) half--;
  int c = 0;
  for (int i = 0; i <= half; i++) {
    c += temp[i];
    if (c % 2) {
      char ch = s[len - i - 1];
      s[len - i - 1] = s[i];
      s[i] = ch;
    }
  }
  cout << s;
  return 0;
}
