The first line of the input contains Pasha‘s string s of length from 2 to 2·105 characters, consisting of lowercase Latin letters.
The second line contains a single integer m (1 ≤ m ≤ 105) — the number of days when Pasha changed his string.
The third line contains m space-separated elements ai (1 ≤ ai; 2·ai ≤ |s|) — the position from which Pasha started transforming the string on the i-th day.
//qscqesze
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 400010
#define mod 10007
#define eps 1e-9
//const int inf=0x7fffffff; //无限大
const int inf=0x3f3f3f3f;
/*
*/
//**************************************************************************************
inline ll read()
{
int x=0,f=1;char ch=getchar();
while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}
return x*f;
}
int flag[maxn];
int main()
{
string s;
cin>>s;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
int x=read();
flag[x-1]++;
}
for(int i=1;i<=s.size()/2;i++)
{
flag[i]+=flag[i-1];
}
for(int i=0;i<s.size();i++)
{
if(i<s.size()/2)
{
if(flag[i]%2==0)
cout<<s[i];
else
cout<<s[s.size()-i-1];
}
else
{
if(flag[s.size()-i-1]%2==0)
cout<<s[i];
else
cout<<s[s.size()-i-1];
}
}
}