Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
511 B
4
Indexable
Never
//
// Created by xingchaoyue on 2022/10/21.
//

#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main(){
    string s;
    cin>>s;
    int n;
    cin>>n;
    int ls,rs;
    ls = 0;
    rs =s.size();
    for(int i = 0;i<n;++i){
        int start,length;
        cin>>start>>length;
        if(start+length-1>=rs)continue;

        ls = ls+start;
        rs = ls+start+length;

//        cout<<s<<endl;
    }

    for(int i = ls;i<rs;++i){
        cout<<s[i];
    }
    cout<<endl;

}