#include <bits/stdc++.h>
using namespace std;
string s;
int m, arr[100000], fq[100000], sum[100000];
int main() {
  cin >> s;
  cin >> m;
  int l = s.length();
  for (int i = 0; i < m; i++) {
    cin >> arr[i];
    arr[i]--;
    fq[arr[i]]++;
  }
  sum[0] = fq[0];
  for (int i = 1; i < l / 2; i++) sum[i] += sum[i - 1] + fq[i];
  for (int i = 0; i < l / 2; i++) {
    if (sum[i] % 2 != 0) swap(s[i], s[l - i - 1]);
  }
  cout << s << endl;
}
