#include <bits/stdc++.h>
using namespace std;
int A[200005];
vector<long long> v;
int main() {
  string s;
  while (cin >> s) {
    memset(A, 0, sizeof A);
    v.clear();
    long long n;
    cin >> n;
    long long m;
    for (long long i = 0; i < n; i++) {
      cin >> m;
      A[m]++;
    }
    for (long long i = 1; i <= s.length() / 2; i++) {
      A[i] = A[i] % 2;
      if (A[i] != 0) v.push_back(i);
    }
    for (long long i = 1; i < v.size(); i += 2) {
      long long start = v[i - 1];
      long long end = v[i];
      string s1 = s.substr(start - 1, end - start);
      string s2 = s.substr(s.length() - start - (end - start - 1), end - start);
      reverse(s1.begin(), s1.end());
      reverse(s2.begin(), s2.end());
      s.replace(start - 1, end - start, s2);
      s.replace(s.length() - start - (end - start - 1), end - start, s1);
    }
    if (v.size() % 2 != 0) {
      long long m = v[v.size() - 1];
      reverse(s.begin() + m - 1, s.end() - m + 1);
    }
    cout << s << endl;
  }
  return 0;
}
