#include <bits/stdc++.h>
using namespace std;
int m, a[1000000];
string s;
void write() {}
void solve() {
  sort(a, a + m);
  int k = 0;
  int t, tp = 0;
  for (int i = 0; i <= (s.length() - 1) / 2; i += 1) {
    t = tp;
    while (a[k] <= i && k <= m - 1) {
      t = (t + 1) % 2;
      k++;
    }
    if (t == 1) swap(s[i], s[s.length() - 1 - i]);
    tp = t;
  }
  cout << s;
}
void read() {
  getline(cin, s);
  cin >> m;
  for (int i = 0; i <= m - 1; i += 1) {
    cin >> a[i];
    a[i]--;
  }
}
int main() {
  read();
  solve();
  write();
}
