#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int n = str.size();
  int m;
  cin >> m;
  int mark[200005] = {};
  for (int i = 1; i <= m; i++) {
    int pos;
    cin >> pos;
    int pos2 = (n - pos) + 1;
    int Min = min(pos, pos2);
    int Max = max(pos, pos2);
    mark[Min] += 1;
    mark[Max + 1] -= 1;
  }
  for (int i = 1; i <= n; i++) {
    mark[i] = mark[i - 1] + mark[i];
  }
  for (int i = 1; i <= n / 2; i++) {
    if (mark[i] % 2 == 1) {
      int pos = (n - i) + 1;
      char c = str[i - 1];
      str[i - 1] = str[pos - 1];
      str[pos - 1] = c;
    }
  }
  cout << str << endl;
  return 0;
}
