#include <bits/stdc++.h>
using namespace std;
long a[200000];
int main() {
  string s;
  cin >> s;
  long m;
  scanf("%ld", &m);
  for (long i = 0; i < m; i++) scanf("%ld", &a[i]);
  sort(a, a + m);
  long cnt = 0;
  for (long i = 0; i < s.size() / 2; i++) {
    while (a[cnt] - 1 == i) cnt++;
    if (cnt % 2 == 1) swap(s[i], s[s.size() - i - 1]);
  }
  cout << s;
}
