#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  long long int sum = 0, len, m, i, x, arr[200005];
  cin >> str;
  len = str.length();
  for (i = 0; i < len; i++) arr[i] = 0;
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> x;
    arr[x - 1] = arr[x - 1] + 1;
  }
  for (i = 0; i < len / 2; i++) {
    sum = sum + arr[i];
    if (sum % 2 != 0) {
      char ch = str[i];
      str[i] = str[len - 1 - i];
      str[len - 1 - i] = ch;
    }
  }
  cout << str << endl;
}
