#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int n, i;
  cin >> n;
  vector<int> vt;
  for (i = 0; i < n; ++i) {
    int a;
    cin >> a;
    vt.push_back(a);
  }
  sort(vt.begin(), vt.end());
  int t = str.length() / 2 + 1;
  int dp[200009];
  for (i = 0; i <= str.length() / 2; ++i) dp[i] = 0;
  dp[vt[0]] = 1;
  for (i = 1; i < n; ++i) {
    if (vt[i - 1] == vt[i])
      dp[vt[i]] += 1;
    else
      dp[vt[i]] = dp[vt[i - 1]] + 1;
  }
  if (vt[n - 1] < str.length() / 2) {
    for (i = vt[n - 1] + 1; i <= str.length(); ++i) dp[i] = dp[vt[n - 1]];
  }
  for (i = vt[0] + 1; i <= str.length(); ++i) {
    if (dp[i] == 0) {
      dp[i] = dp[i - 1];
    }
  }
  for (i = 1; i <= str.length() / 2; ++i) {
    if (dp[i] != 0) {
      if (dp[i] % 2 == 1) {
        char temp = str[i - 1];
        str[i - 1] = str[str.length() - i + 1 - 1];
        str[str.length() - i + 1 - 1] = temp;
      }
    }
  }
  cout << str;
}
