#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265358979323846;
long long MOD = 1e9 + 7;
const char nl = '\n';
const long long inf = 1e15;
long long nxt() {
  long long x;
  cin >> x;
  return x;
}
long long mul(long long x, long long y) {
  return (1ll * (x % MOD) * (y % MOD));
}
long long modpow(long long x, long long y) {
  long long z = 1;
  while (y > 0) {
    if (y % 2) z = mul(z, x);
    x = mul(x, x);
    y /= 2;
  }
  return z;
}
long long power(long long x, long long y) {
  long long z = 1;
  while (y > 0) {
    if (y % 2) z = z * x;
    x = x * x;
    y /= 2;
  }
  return z;
}
long long gcd(long long a, long long b) {
  if (a < b) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long sq(long long a) {
  long long ans = (1ll * a * a);
  return ans;
}
const long long N = 100001;
vector<long long> p(N, -1);
void solve() {
  string s;
  cin >> s;
  long long n = (long long)(s.size());
  long long m;
  cin >> m;
  long long a[m];
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    --a[i];
  }
  sort(a, a + m);
  for (long long i = 0; i < m; i++) {
    p[a[i]] = (i + 1) % 2;
  }
  for (long long i = (1); i < n / 2; i++) {
    if (p[i] == -1) p[i] = p[i - 1];
  }
  for (long long i = 0; i < n / 2; i++) {
    if (p[i] == 1) swap(s[i], s[n - 1 - i]);
  }
  cout << s << nl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long TC = 1;
  for (long long TT = 0; TT < TC; TT++) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
