#include <bits/stdc++.h>
using namespace std;
string s;
int cnt[200005];
int main() {
  memset(cnt, 0, sizeof cnt);
  int days, temp;
  cin >> s >> days;
  for (int i = 0; i < days; ++i) {
    cin >> temp;
    ++cnt[temp];
  }
  int len = s.length();
  for (int i = 1; i <= (len / 2); ++i) {
    cnt[i] += cnt[i - 1];
    cnt[len - i + 1] = cnt[i];
  }
  for (int i = 0; i < len; ++i) {
    if (cnt[i + 1] & 1) {
      cout << s[len - i - 1];
      continue;
    }
    cout << s[i];
  }
}
