#include <bits/stdc++.h>
using namespace std;
typedef istringstream iss;
typedef ostringstream oss;
int c[1000000];
int main() {
  string s;
  cin >> s;
  int m;
  scanf("%d", &m);
  int mid = 0;
  mid = s.size() / 2;
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    --a;
    c[a] += 1;
    c[mid] -= 1;
  }
  for (int i = 1; i < s.size(); i++) {
    c[i] += c[i - 1];
  }
  for (int i = 0; i < s.size(); i++) {
    if (c[i] % 2 == 1) {
      swap(s[i], s[s.size() - i - 1]);
    }
  }
  cout << s << endl;
  return 0;
}
