#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 100;
char s[N];
int arr[N] = {};
int main() {
  cin >> s;
  int n = (int)strlen(s);
  int q;
  cin >> q;
  while (q--) {
    int l;
    cin >> l;
    arr[l]++;
  }
  int sum = 0;
  for (int i = 0; i < n / 2; ++i) {
    sum += arr[i + 1];
    if (sum % 2) {
      char temp = s[i];
      s[i] = s[n - i - 1];
      s[n - i - 1] = temp;
    }
  }
  cout << s << endl;
  return 0;
}
