#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
inline long long read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int flag[400010];
int main() {
  string s;
  cin >> s;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x = read();
    flag[x - 1]++;
  }
  for (int i = 1; i <= s.size() / 2; i++) {
    flag[i] += flag[i - 1];
  }
  for (int i = 0; i < s.size(); i++) {
    if (i < s.size() / 2) {
      if (flag[i] % 2 == 0)
        cout << s[i];
      else
        cout << s[s.size() - i - 1];
    } else {
      if (flag[s.size() - i - 1] % 2 == 0)
        cout << s[i];
      else
        cout << s[s.size() - i - 1];
    }
  }
}
