#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  int n = a.size();
  int f[200005] = {0};
  int m;
  cin >> m;
  int x;
  for (int i = 0; i < m; i++) {
    cin >> x;
    x--;
    f[x] = 1 - f[x];
  }
  char left[200005] = {0};
  char right[200005] = {0};
  int p = 0;
  int q = 0;
  int flag = 0;
  for (int i = 0; i < n / 2; i++) {
    if (f[i] == 1) {
      flag = 1 - flag;
    }
    if (flag == 0) {
      left[p++] = a[i];
      right[q++] = a[n - i - 1];
    } else {
      left[p++] = a[n - i - 1];
      right[q++] = a[i];
    }
  }
  if (n & 1) {
    left[p++] = a[n / 2];
  }
  reverse(right, right + q);
  cout << left << right << endl;
}
