#include <bits/stdc++.h>
using namespace std;
int main() {
  string cad;
  int n, m, V[200020];
  while (cin >> cad) {
    cin >> n;
    memset(V, 0, cad.size() * 4);
    while (n--) {
      cin >> m;
      m--;
      V[m]++;
      V[cad.size() - m - 1]++;
    }
    for (int i = 0, j = cad.size() - 1; i < cad.size() >> 1; i++, j--) {
      if (V[i] & 1) swap(cad[i], cad[j]);
      V[i + 1] += V[i];
    }
    cout << cad << "\n";
  }
  return 0;
}
