 
/* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
 
#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d",&n)
#define lscf(n) scanf("%lld",&n)
#define lpri(n) printf("%lld ",n)
#define pri(n) printf("%d ",(int)n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define rep(i,ini,n) for(ll i=ini;i<(int)n;i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x)     x.begin(),x.end()
#define tc   int tt; scf(tt); while(tt--)
#define inf INT_MAX
#define ninf INT_MIN
#define gcd __gcd
#define bitcount(n) __builtin_popcount(n)
typedef double dd;
using namespace std;
const ll mod =1e9+7;
const int N = 1e6+7;

void my_dbg() { cout << endl; }
template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B) 
{ cout << ' ' << A; my_dbg(B...); }
#define dbg(...) cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)

  
int main()
{
    int n;
    scf(n);
    
    if(n==1)
    cout<<"Hello World";
    
    else
    {
        int a,b;
        scf(a),scf(b);
        
        prin(a+b);
        
 
    }
 
    
}
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	string str;
	int q;
	int a,b;
	string p;
	string query;
	
	
	cin>>str;
	cin>>q;
	for(int i=0;i<q;++i){
		cin>>query;
		cin>>a>>b;
		
		if(query=="print"){
			cout<<str.substr(a,b-a+1)<<endl;
		}else if(query=="reverse"){
			reverse(&(str[a]), &(str[b+1]));
		}else if(query=="replace"){
			cin>>p;
			for(int j=0;j<b-a+1;++j){
				str[a+j] = p[j];
			}
		}
	}
}