#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const int maxn = 200100;
int n, m;
char second[maxn];
char rs[maxn];
int cnt[maxn];
vector<int> v;
char res[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> (second + 1);
  n = strlen(second + 1);
  for (int i = 1; i <= n; i++) {
    rs[i] = second[n - i + 1];
  }
  cin >> m;
  for (int i = 1; i <= m; i++) {
    int a;
    cin >> a;
    cnt[a]++;
  }
  for (int i = 1; i <= n / 2; i++) {
    if (cnt[i] > 0) {
      v.push_back(i);
    }
  }
  v.push_back(n / 2 + 1);
  for (int i = 1; i <= n; i++) {
    res[i] = second[i];
  }
  long long cur = 0;
  for (int i = 0; i < (int)(v).size() - 1; i++) {
    int x = v[i];
    int y = v[i + 1];
    cur += cnt[x];
    for (int j = x; j <= y - 1; j++) {
      if (cur % 2 == 0) {
        res[j] = second[j];
      } else {
        res[j] = rs[j];
      }
    }
    for (int j = n - y + 2; j <= n - x + 1; j++) {
      if (cur % 2 == 0) {
        res[j] = second[j];
      } else {
        res[j] = rs[j];
      }
    }
  }
  cout << (res + 1);
  return 0;
}
