#include <bits/stdc++.h>
using namespace std;
char c[200005];
int co[200005];
int sum[200005];
int main() {
  memset(co, 0, sizeof(co));
  string s;
  cin >> s;
  int l = s.length();
  s = " " + s;
  int m;
  cin >> m;
  while (m--) {
    int a;
    cin >> a;
    co[a]++;
  }
  sum[0] = 0;
  for (int i = 1; i <= l / 2; i++) {
    sum[i] = co[i] + sum[i - 1];
  }
  for (int i = 1; i <= l / 2; i++) {
    if (sum[i] % 2 == 1) {
      swap(s[i], s[l - i + 1]);
    }
  }
  s.erase(s.begin());
  cout << s;
  return 0;
}
