#include <bits/stdc++.h>
using namespace std;
string s;
int n, m;
bool change[200010], now;
int main(void) {
  cin >> s >> m;
  n = s.length();
  memset(change, false, sizeof(change));
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    x--;
    change[x] = !change[x];
  }
  now = false;
  string ans = "";
  for (int i = 0; i <= (n - 1) / 2; i++) {
    if (change[i]) now = !now;
    if (now)
      ans += s[n - 1 - i];
    else
      ans += s[i];
  }
  for (int i = (n + 1) / 2; i < n; i++) {
    ans += (ans[n - 1 - i] == s[i]) ? s[n - 1 - i] : s[i];
  }
  cout << ans << "\n";
  return 0;
}
