#include <bits/stdc++.h>
using namespace std;
const int INF = 2123456789;
int a, b, c;
int n, m, k;
int x, y;
int t[100007];
string s;
vector<int> v;
int main() {
  cin >> s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    t[x]++;
  }
  int sum = 0;
  for (int i = 0; i < s.length() / 2 + 1; i++) {
    sum += t[i];
    t[i] = sum;
  }
  for (int i = 1; i < s.length() / 2 + 1; i++)
    if ((t[i] % 2) == 1) swap(s[i - 1], s[s.length() - i]);
  cout << s << endl;
  return 0;
}
