#include <bits/stdc++.h>
using namespace std;
template <typename T>
string toString(T x) {
  if (x == 0) return "0";
  bool negative = x < 0;
  string res;
  while (x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  if (negative) res.push_back('-');
  reverse(res.begin(), res.end());
  return res;
}
template <typename T>
T gcd(T a, T b) {
  return a == 0 ? b : gcd(b % a, a);
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
int main() {
  string s;
  cin >> s;
  vector<int> a(s.length() / 2);
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    t--;
    a[t]++;
  }
  int l = s.length() / 2;
  vector<bool> r(l);
  int carry = 0;
  for (int i = 0; i < l; i++) {
    int t = a[i] + carry;
    carry = t % 2;
    r[i] = carry;
  }
  for (int i = 0; i < l; i++) {
    if (r[i]) {
      cout << s[s.length() - 1 - i];
    } else {
      cout << s[i];
    }
  }
  if (s.length() % 2 == 1) {
    cout << s[l];
    l++;
  }
  for (int i = (s.length() + 1) / 2; i < s.length(); i++) {
    if (r[s.length() - 1 - i]) {
      cout << s[s.length() - 1 - i];
    } else {
      cout << s[i];
    }
  }
  return 0;
}
