#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
string s;
int m;
int a[maxn];
int main() {
  while (cin >> s) {
    memset(a, 0, sizeof(a));
    cin >> m;
    while (m--) {
      int tmp;
      cin >> tmp;
      a[tmp - 1]++;
    }
    int k = 0;
    for (int i = 0; i < s.size() / 2; i++) {
      k += a[i];
      if (k % 2) {
        swap(s[i], s[s.size() - 1 - i]);
      }
    }
    cout << s << endl;
  }
  return 0;
}
