#include <bits/stdc++.h>
using namespace std;
const int MAXM = 100005;
string s;
int M;
int A[MAXM];
int pref[2 * MAXM];
int main() {
  cin >> s;
  cin >> M;
  for (int i = 0; i < M; i++) {
    scanf("%d", &A[i]);
    A[i]--;
    pref[A[i]]++;
  }
  for (int i = 1; i < MAXM; i++) {
    pref[i] += pref[i - 1];
  }
  for (int i = 0; i < s.size() / 2; i++) {
    if (pref[i] % 2) {
      swap(s[i], s[s.size() - 1 - i]);
    }
  }
  cout << s;
}
