#include <bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005];
int main() {
  string s;
  cin >> s;
  int len = s.length();
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    ++b[x];
  }
  for (int i = 1; i <= len / 2; i++) {
    a[i] = a[i - 1] + b[i];
  }
  for (int i = 1; i <= len / 2; i++) {
    if (a[i] % 2 == 1) {
      swap(s[i - 1], s[len - i]);
    }
  }
  cout << s;
  return 0;
}
