#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int m;
  cin >> s >> m;
  bool swped[s.length() + 1];
  memset(swped, false, sizeof(swped));
  for (int ctr1 = 0; ctr1 < m; ctr1++) {
    int a;
    cin >> a;
    a--;
    swped[a] = !swped[a];
    swped[s.length() - a] = !swped[s.length() - a];
  }
  bool sw = false;
  for (int ctr1 = 0; ctr1 < s.length(); ctr1++) {
    sw = (sw ^ swped[ctr1]);
    if (!sw)
      cout << s[ctr1];
    else
      cout << s[s.length() - ctr1 - 1];
  }
  return 0;
}
