For this Question: Given a string S. The letters are numbered from 1 to |S| from left to right. You have to perform M operations. In each operation, you will be given a number P<sub>i</sub>. You need to reverse the substring from P<sub>i</sub> to |S| - P<sub>i</sub> + 1. Print the final string after all the operations.

It is guaranteed that 2*P<sub>i</sub> <= |S|

|S| denotes the length of string SThe first line contains a string S. Second line contains a single integer M. Third line contains M space separated integers denoting the value of P<sub>i</sub>.

1 <= |S| <= 100000
1 <= M <= 100000
1 <= P<sub>i</sub> <= ceil(|S|/2)Print a single line containing the final string after all the operationsSample Input:
abcdef
3
1 2 3

Sample Output:
fbdcea

Explanation:
After 1st step, S = fedcba
After 2nd step, S = fbcdea
After 3rd step, S = fbdcea, I have written this Solution Code: #include<bits/stdc++.h>
#define int            long long
#define ll             long long
#define pb          push_back
#define    endl        '\n'
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define dep(i,a,b)    for(int i=a;i>=b;i--)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
using namespace std;

const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int a[N];

void solve(){
    string s;   cin >> s;
    int m;  cin >> m;
    int n = s.length();
    for(int i = 1; i <= m; i++){
        int x;  cin >> x;
        a[x]++;
        a[n-x+2]--;
    }
    for(int i = 1; i <= (n-1)/2 + 1; i++){
        a[i] += a[i-1];
        if(a[i]&1)
            swap(s[i-1], s[n-i]);
    }
    cout << s;
}

void testcases(){
    int tt = 1; 
    //cin >> tt;
    while(tt--){
        solve();
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

 		clock_t start = clock();
 	

    testcases();


 		cerr << (double)(clock() - start)*1000/CLOCKS_PER_SEC << " ms: ";
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?