#include <bits/stdc++.h>
using namespace std;
// 模拟 字符串
int main() {
int n, q, l, r;
string str;
cin >> n >> q;
cin >> str;
while (q--) {
cin >> l >> r;
string new_str;
for (int i = 0; i < str.size(); i++) {
if (i >= l - 1 && i <= r - 1) {
// 翻倍操作
new_str += str[i];
new_str += str[i];
} else {
// 区间外的加一次
new_str += str[i];
}
}
str = new_str;
}
cout << str << endl;
}

京公网安备 11010502036488号