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