#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
long long n, m, x, y;
map<long long, long long> a;
int main() {
  string s;
  cin >> s;
  cin >> n;
  int rev = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a[x - 1]++;
  }
  for (int i = 0; i < s.size() / 2; i++) {
    int k = a[i] + rev;
    if (k % 2 != 0) {
      swap(s[i], s[s.size() - i - 1]);
      rev = 1;
    } else {
      rev = 0;
    }
  }
  cout << s;
  return 0;
}
