#include <bits/stdc++.h>
using namespace std;
const int N = 202020;
int a[N], n, m, x;
string s;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s;
  n = s.size();
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x;
    int y = n - x + 1;
    a[x]++, a[y + 1]--;
  }
  for (int i = 1; i < N; i++) a[i] += a[i - 1];
  for (int i = 1; i <= (int)s.size() / 2; i++)
    if (a[i] & 1) swap(s[i - 1], s[n - i]);
  cout << s;
  return 0;
}
