#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 55;
const int inf = 1e9 + 77;
const int MOD = 1e9 + 7;
const double PI = 3.14159265359;
const double eps = 1e-7;
int arr[2 * MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int m;
  cin >> m;
  int n = s.size();
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    arr[x - 1] += 1;
    arr[n - x + 1] += -1;
  }
  for (int i = 1; i < 2 * MAX; ++i) arr[i] += arr[i - 1];
  for (int i = 0; i < 2 * MAX; ++i) arr[i] %= 2;
  for (int i = 0, j = n - 1; i < n, i < j; ++i, --j) {
    if (arr[i] && arr[j]) swap(s[i], s[j]);
  }
  cout << s;
  return 0;
}
