#include <bits/stdc++.h>
using namespace std;
int absolute(int a, int b) { return max(a, b) - min(a, b); }
class Union_Find {
  vector<long long> rank;
  vector<long long> parent;
  long long size;

 public:
  int find_set(long long i) {
    return (parent[i] == i) ? i : parent[i] = find_set(parent[i]);
  }
  bool is_same(long long a, long long b) { return find_set(a) == find_set(b); }
  void join(long long a, long long b) {
    if (is_same(a, b)) return;
    a = find_set(a);
    b = find_set(b);
    if (rank[a] > rank[b])
      parent[b] = a;
    else if (rank[b] > rank[a])
      parent[a] = b;
    else {
      parent[a] = b;
      rank[b]++;
    }
  }
  void clear(long long n) {
    size = n;
    rank.resize(size, 0);
    parent.resize(size, 0);
    for (int i = 0; i < size; i++) parent[i] = i;
  }
  Union_Find(long long n) {
    size = n;
    rank.resize(size, 0);
    parent.resize(size, 0);
    for (int i = 0; i < size; i++) parent[i] = i;
  }

 private:
};
const int MAX = 10e5 + 3;
const long long INF = 10e9 + 3;
const long long MOD = 1000000007;
const double EPS = 10e-10;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int n, q;
  n = int((s).size());
  cin >> q;
  vector<int> change(n, 0);
  for (int i = 0; i < q; i++) {
    int a;
    cin >> a;
    a--;
    change[a]++;
  }
  for (int i = 1; i < n; i++) change[i] += change[i - 1];
  for (int i = 0; i < (n / 2); i++) {
    if (change[i] % 2 == 1) swap(s[i], s[n - i - 1]);
  }
  cout << s << "\n";
  return 0;
}
