#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int D;
  cin >> D;
  vector<int> A(S.size(), 0);
  for (; D--;) {
    int N;
    cin >> N;
    --N;
    ++A[N];
  }
  int count = 0;
  for (int i = 0; i < S.size() / 2; ++i) {
    count += A[i];
    if (count & 1) {
      swap(S[i], S[S.size() - i - 1]);
    }
  }
  cout << S << "\n";
}
