#include <bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  int m;
  cin >> s >> m;
  vector<int> a(2e5 + 1);
  int x;
  while (m--) {
    cin >> x;
    a[x]++;
  }
  for (int i = 1; i <= s.size() / 2; i++) {
    a[i] += a[i - 1];
    if (a[i] % 2) swap(s[i - 1], s[s.size() - i]);
  }
  cout << s << endl;
}
