#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string z;
  int n, arr[100010], length;
  cin >> z >> n;
  length = z.length();
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    arr[i]--;
  }
  sort(arr, arr + n);
  int a[200010] = {0}, idx;
  for (int i = length / 2 - 1; i >= 0; i--) {
    idx = upper_bound(arr, arr + n, i) - arr;
    if (idx % 2 == 0)
      a[i] = 0;
    else
      a[i] = 1;
  }
  string z1 = z;
  int last = length / 2;
  for (int i = length / 2 - 1; i >= 0; i--) {
    if (a[i] == 0)
      last = i;
    else {
      for (int j = i, k = length - i - 1; (j < last && k > length - last - 1);
           j++, k--) {
        z1[j] = z[k];
        z1[k] = z[j];
      }
      last = i;
    }
  }
  cout << z1;
  return 0;
}
