#include <bits/stdc++.h>
using namespace std;
using namespace placeholders;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<vector<int> >;
using VS = vector<string>;
using SS = stringstream;
using PII = pair<int, int>;
using VPII = vector<pair<int, int> >;
template <typename T = int>
using VT = vector<T>;
template <typename T = int>
using VVT = vector<vector<T> >;
template <typename T = int>
using LIM = numeric_limits<T>;
template <typename T>
inline istream &operator>>(istream &s, vector<T> &v) {
  for (T &t : v) {
    s >> t;
  }
  return s;
}
template <typename T>
inline ostream &operator<<(ostream &s, const vector<T> &v) {
  for (int i = 0; i < int(v.size()); ++i) {
    s << (" " + !i) << v[i];
  }
  return s;
}
template <typename T>
inline T fromString(const string &s) {
  T res;
  istringstream iss(s);
  iss >> res;
  return res;
};
template <typename T>
inline string toString(const T &a) {
  ostringstream oss;
  oss << a;
  return oss.str();
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  int M;
  cin >> M;
  VI as(M);
  cin >> as;
  transform((as).begin(), (as).end(), as.begin(), bind(minus<int>(), _1, 1));
  const int N = ((int)(S).size());
  VI counts(N + 1);
  for (auto &a : as) {
    ++counts[a];
    --counts[N - a];
  }
  partial_sum((counts).begin(), (counts).end(), counts.begin());
  for (int i = (int)(0); i < (int)(N / 2); ++i) {
    if (counts[i] % 2) {
      swap(S[i], S[N - 1 - i]);
    }
  }
  cout << S << endl;
  return 0;
}
