#include <bits/stdc++.h>
using namespace std;
int main() {
  string s = *istream_iterator<string>(cin);
  size_t n = *istream_iterator<int>(cin);
  vector<int> pos(s.size() / 2, 0);
  for (size_t i = 0; i < n; i++) ++pos[*istream_iterator<int>(cin) - 1];
  int sum = 0;
  for (size_t i = 0; i < s.size() / 2; i++)
    if ((sum += pos[i]) % 2 == 1) swap(s[i], s[s.size() - i - 1]);
  ostream_iterator<string>(cout, "") = s;
}
