#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 0x3c3c3c3c;
const ll INFL = 0x3c3c3c3c3c3c3c3c;
const int MAX_N = 2e5 + 9;
int cnt[MAX_N];
int main() {
  string s;
  cin >> s;
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    int v;
    cin >> v;
    cnt[v - 1] += 1;
  }
  int len = s.size();
  int sum = 0;
  for (int i = 0; i < len / 2; i++) {
    sum += cnt[i];
    if (sum % 2) {
      swap(s[i], s[len - 1 - i]);
    }
  }
  printf("%s", s.c_str());
}
