#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<int> v(s.size() / 2);
  int m, n;
  cin >> m;
  while (m > 0) {
    cin >> n;
    ++v[n - 1];
    --m;
  }
  for (int i = 1; i < v.size(); ++i) {
    v[i] += v[i - 1];
  }
  for (int i = 0; i < v.size(); ++i) {
    if (v[i] % 2 == 1) {
      char c = s[i];
      s[i] = s[s.size() - i - 1];
      s[s.size() - i - 1] = c;
    }
  }
  cout << s << endl;
}
