#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 1e3 + 2;
const long long int mod = 1e3 + 2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  long long int n = s.length(), m;
  cin >> m;
  long long int a[n + 2];
  for (long long int i = 0; i <= n; i++) a[i] = 0;
  for (long long int i = 0; i < m; i++) {
    long long int x;
    cin >> x;
    --x;
    a[x] = a[x] + 1;
  }
  for (long long int i = 1; i < n; i++) a[i] = a[i - 1] + a[i];
  for (long long int i = 0; i < n / 2; i++) {
    if (a[i] % 2) {
      swap(s[i], s[n - i - 1]);
    }
  }
  cout << s << endl;
  return 0;
}
