#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define endl '\n'
#define maxl __LONG_LONG_MAX__
#define pb push_back
#define F first
#define S second
#define rep(i, n) for(int i = 0; i < n; i++)
#define rev(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(int i=1; i < n; i++)
#define rev1(i, n) for(int i=n ; i > 0; i--)
#define n_ones(x) __builtin_popcountll(x)
#define n_trailzero(x) __builtin_ctzll(x)
#define n_leadingzero(x) __builtin_clz(x)
#define sz(a) (ll)(a.size())
#define all(v) v.begin(),v.end()
#define FASTIO {ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);}
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a/gcd(a, b))*b
#define PI 3.14159265358979323846
#define see(args...)                       \
{                                            \
    cerr<<"LINE "<<__LINE__;                 \
    string _s = #args;                       \
    replace(_s.begin(), _s.end(), ',', ' '); \
    stringstream _ss(_s);                    \
    istream_iterator<string> _it(_ss);       \
    err(_it, args);                          \
    cerr<<endl;                              \
}
void err(istream_iterator<string> it){}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
  cerr<<' '<< *it << " = " << a ;
  err(++it, args...);
}
template <typename T, typename U>inline void min_self(T &x, U y){if (y < x)x = y;}
template <typename T, typename U>inline void max_self(T &x, U y){if (x < y)x = y;}
template<class T1, class T2>ostream& operator<< (ostream &out, pair<T1, T2> pair) { return out << "(" << pair.first << ", " << pair.second << ")";}
template<class T> ostream& operator<<(ostream& out, vector<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class T> ostream& operator<<(ostream& out, set<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class L, class R> ostream& operator<<(ostream& out, map<L, R> vec) { out<<"("; for (auto& v: vec) out<<"["<<v.first<<", "<<v.second<<"]"; return out<<")"; }
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}

typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pair<ll, ll> > vpll;
typedef vector<vector<ll> > vvll;

// typedef tree<int,null_type,less<int>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_setll;
// typedef tree<char,null_type,less<char>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_setc;

ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);}
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}

// cout<<fixed<<setprecision(20)<<pi<<endl;

ll mod = 1e9 + 7;
ll Test, cas;

void solve()
{
	string s;
	cin>>s;
	ll n = sz(s);
	cout<<3<<endl;
	cout<<"L"<<" "<<2<<endl;
	cout<<"R"<<" "<<n<<endl;
	cout<<"R"<<" "<<(2*n-1)<<endl;
	return;
}

int main()
{
	FASTIO;
	Test = 1;
	//cin>>Test;
	for(cas = 1; cas <= Test; cas++)
		solve();
	return 0;
}


#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define endl '\n'
#define maxl __LONG_LONG_MAX__
#define pb push_back
#define F first
#define S second
#define rep(i, n) for(int i = 0; i < n; i++)
#define rev(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(int i=1; i < n; i++)
#define rev1(i, n) for(int i=n ; i > 0; i--)
#define n_ones(x) __builtin_popcountll(x)
#define n_trailzero(x) __builtin_ctzll(x)
#define n_leadingzero(x) __builtin_clz(x)
#define sz(a) (ll)(a.size())
#define all(v) v.begin(),v.end()
#define FASTIO {ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);}
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a/gcd(a, b))*b
#define PI 3.14159265358979323846
#define see(args...)                       \
{                                            \
    cerr<<"LINE "<<__LINE__;                 \
    string _s = #args;                       \
    replace(_s.begin(), _s.end(), ',', ' '); \
    stringstream _ss(_s);                    \
    istream_iterator<string> _it(_ss);       \
    err(_it, args);                          \
    cerr<<endl;                              \
}
void err(istream_iterator<string> it){}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
  cerr<<' '<< *it << " = " << a ;
  err(++it, args...);
}
template <typename T, typename U>inline void min_self(T &x, U y){if (y < x)x = y;}
template <typename T, typename U>inline void max_self(T &x, U y){if (x < y)x = y;}
template<class T1, class T2>ostream& operator<< (ostream &out, pair<T1, T2> pair) { return out << "(" << pair.first << ", " << pair.second << ")";}
template<class T> ostream& operator<<(ostream& out, vector<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class T> ostream& operator<<(ostream& out, set<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class L, class R> ostream& operator<<(ostream& out, map<L, R> vec) { out<<"("; for (auto& v: vec) out<<"["<<v.first<<", "<<v.second<<"]"; return out<<")"; }
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}

typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pair<ll, ll> > vpll;
typedef vector<vector<ll> > vvll;

// typedef tree<int,null_type,less<int>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_setll;
// typedef tree<char,null_type,less<char>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_setc;

ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);}
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}

// cout<<fixed<<setprecision(20)<<pi<<endl;

ll mod = 1e9 + 7;
ll Test, cas;

void solve()
{
	string s;
	cin>>s;
	cout<<1<<endl;
	cout<<"L"<<" "<<sz(s)<<endl;
	return;
}

int main()
{
	FASTIO;
	Test = 1;
	//cin>>Test;
	for(cas = 1; cas <= Test; cas++)
		solve();
	return 0;
}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
///#pragma GCC target("avx2")
#include <bits/stdc++.h>

using namespace std;
#define open_streams ifstream fin("olympiad.in");ofstream fout("olympiad.out")
#define close_streams fin.close();fout.close()
#define speed cout.tie(0);cin.tie(0);ios_base::sync_with_stdio(0)
#define ll long long
#define ull unsigned long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define UNIQ(a) a.resize(unique(all(a)) - a.begin())
#define eps 1e-7
//const double PI = M_PI
//random_device rd;
//mt19937 Rand(rd());
const int INF = INT_MAX;
const ll limit = 1LL * 1e18;
const int MOD = 1e9 + 711;
const int MOD2 = 1e9 + 933;
//---------------------------------------------------------------------------
const int mod = 1e9 + 7;
const int maxn = 2e5 + 10;

signed main() {
    speed;
    string s;
    cin >> s;
    int n = s.size();
    if(s.size()==3) {
        cout << "1\nR 2";
    }
    else {
        cout << "4\nL " << n-1 << "\nR " << 2*n-3 << "\nL " << 2*n-2 << "\nL 2";
    }
    return 0;
}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
///#pragma GCC target("avx2")
#include <bits/stdc++.h>

using namespace std;
#define open_streams ifstream fin("olympiad.in");ofstream fout("olympiad.out")
#define close_streams fin.close();fout.close()
#define speed cout.tie(0);cin.tie(0);ios_base::sync_with_stdio(0)
#define ll long long
#define ull unsigned long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define UNIQ(a) a.resize(unique(all(a)) - a.begin())
#define eps 1e-7
//const double PI = M_PI
//random_device rd;
//mt19937 Rand(rd());
const int INF = INT_MAX;
const ll limit = 1LL * 1e18;
const int MOD = 1e9 + 711;
const int MOD2 = 1e9 + 933;
//---------------------------------------------------------------------------
const int mod = 1e9 + 7;
const int maxn = 2e5 + 10;

signed main() {
    speed;
    string s;
    cin >> s;
    int n = s.size();
    cout << "4\nL " << n-1 << "\nR " << 2*n-3 << "\nL " << 2*n-2 << "\nL 2";
    return 0;
}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
///#pragma GCC target("avx2")
#include <bits/stdc++.h>

using namespace std;
#define open_streams ifstream fin("olympiad.in");ofstream fout("olympiad.out")
#define close_streams fin.close();fout.close()
#define speed cout.tie(0);cin.tie(0);ios_base::sync_with_stdio(0)
#define ll long long
#define ull unsigned long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define UNIQ(a) a.resize(unique(all(a)) - a.begin())
#define eps 1e-7
//const double PI = M_PI
//random_device rd;
//mt19937 Rand(rd());
const int INF = INT_MAX;
const ll limit = 1LL * 1e18;
const int MOD = 1e9 + 711;
const int MOD2 = 1e9 + 933;
//---------------------------------------------------------------------------
const int mod = 1e9 + 7;
const int maxn = 2e5 + 10;

signed main() {
    speed;
    string s;
    cin >> s;
    int n = s.size();
    if(s.size()==3) {
        cout << "1\nR 2";
    }
    else {
        cout << "4\nL " << n-1 << "\nR " << n+1 << "\nL " << n+2 << "\nL 2";
    }
    return 0;
}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
///#pragma GCC target("avx2")
#include <bits/stdc++.h>

using namespace std;
#define open_streams ifstream fin("olympiad.in");ofstream fout("olympiad.out")
#define close_streams fin.close();fout.close()
#define speed cout.tie(0);cin.tie(0);ios_base::sync_with_stdio(0)
#define ll long long
#define ull unsigned long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define UNIQ(a) a.resize(unique(all(a)) - a.begin())
#define eps 1e-7
//const double PI = M_PI
//random_device rd;
//mt19937 Rand(rd());
const int INF = INT_MAX;
const ll limit = 1LL * 1e18;
const int MOD = 1e9 + 711;
const int MOD2 = 1e9 + 933;
//---------------------------------------------------------------------------
const int mod = 1e9 + 7;
const int maxn = 2e5 + 10;

signed main() {
    speed;
    string s;
    cin >> s;
    if(s.size()==3) {
        cout << "1\nR 2";
    }
    else {
        cout << "2\nL " << s.size()-2 << "\nR 2";
    }
    return 0;
}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
///#pragma GCC target("avx2")
#include <bits/stdc++.h>

using namespace std;
#define open_streams ifstream fin("olympiad.in");ofstream fout("olympiad.out")
#define close_streams fin.close();fout.close()
#define speed cout.tie(0);cin.tie(0);ios_base::sync_with_stdio(0)
#define ll long long
#define ull unsigned long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define UNIQ(a) a.resize(unique(all(a)) - a.begin())
#define eps 1e-7
//const double PI = M_PI
//random_device rd;
//mt19937 Rand(rd());
const int INF = INT_MAX;
const ll limit = 1LL * 1e18;
const int MOD = 1e9 + 711;
const int MOD2 = 1e9 + 933;
//---------------------------------------------------------------------------
const int mod = 1e9 + 7;
const int maxn = 2e5 + 10;

signed main() {
    speed;
    string s;
    cin >> s;
    cout << "1\nL " << s.size();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

string s;

int main()
{
	cin >> s;
	cout << 3 << endl;
	cout << 'L' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 3 << endl;
	cout << 'R' << ' ' << 2 * s.length() + 1 << endl;
}


#include<bits/stdc++.h>
using namespace std;

string s;

int main()
{
	cin >> s;
	cout << 3 << endl;
	cout << 'L' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 3 << endl;
	//cout << 'R' << ' ' << 2 * s.length() - 1 << endl;
}


#include<bits/stdc++.h>
using namespace std;

string s;

int main()
{
	cin >> s;
	cout << 3 << endl;
	cout << 'L' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 3 << endl;
	cout << 'R' << ' ' << 7 << endl;
}


#include<bits/stdc++.h>
using namespace std;

string s;

int main()
{
	cin >> s;
	cout << 3 << endl;
	cout << 'L' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 7 << endl;
}


#include<bits/stdc++.h>
using namespace std;

string s;

int main()
{
	cin >> s;
	cout << 3 << endl;
	cout << 'L' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 3 << endl;
	cout << 'R' << ' ' << 2 * s.length() - 1 << endl;
}


#include<bits/stdc++.h>
using namespace std;

string s;

int main()
{
	cin >> s;
	cout << 2 << endl;
	cout << 'L' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 3 << endl;
	//cout << 'R' << ' ' << 2 * s.length() - 1 << endl;
}


#include<bits/stdc++.h>
using namespace std;

string s;

int main()
{
	cin >> s;
	cout << 3 << endl;
	cout << 'L' << ' ' << 3 << endl;
	cout << 'R' << ' ' << 3 << endl;
	cout << 'R' << ' ' << 2 * s.length() - 1 << endl;
}


#include<bits/stdc++.h>
using namespace std;

string s;

int main()
{
	cin >> s;
	cout << 3 << endl;
	cout << 'L' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 2 << endl;
	cout << 'R' << ' ' << 2*s.length()-1 << endl;
}


#include <bits/stdc++.h>

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

int main() {
    FAST;

    string s;
    cin >> s;

    int n = s.size();

    cout << 3 << endl;
    cout << "L " << 2 << endl;
    cout << "R " << 2 << endl;
    cout << "R " << 2*n-1 << endl;

    return 0;
}


#include <bits/stdc++.h>

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

int main() {
    FAST;

    string s;
    cin >> s;

    int n = s.size(), i, ans = 0;

    bool f = 1;
    for (i = 0; i < n/2; ++i) {
        if (s[i] != s[n-1-i]) {
            f = 0;
            break;
        }
    }

    if (f) {
        cout << 0 << endl;
    } else {
        cout << 3 << endl;
        cout << "R " << n-1 << endl;
        n += n-2;
        cout << "L " << 2   << endl;
        n += n-2;
        cout << "R " << n-1 << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

int main() {
    FAST;

    string s;
    cin >> s;

    int n = s.size(), i, ans = 0;

    bool f = 1;
    for (i = 0; i < n/2; ++i) {
        if (s[i] != s[n-1-i]) {
            f = 0;
            break;
        }
    }

    if (f) {
        cout << 0 << endl;
    } else {
        cout << 1 << endl;
        cout << "L " << n << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

int main() {
    FAST;

    string s;
    cin >> s;

    int n = s.size();

    cout << 3 << endl;
    cout << "L " << 2 << endl;
    cout << "R " << 2 << endl;
    cout << "R " << n-1 << endl;

    return 0;
}


#include <bits/stdc++.h>

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

int main() {
    FAST;

    string s;
    cin >> s;

    int n = s.size(), i, ans = 0;

    bool f = 1;
    for (i = 0; i < n/2; ++i) {
        if (s[i] != s[n-1-i]) {
            f = 0;
            break;
        }
    }

    if (f) {
        cout << 0 << endl;
    } else {
        cout << 3 << endl;
        cout << "R " << n-1 << endl;
        cout << "L " << 2   << endl;
        cout << "R " << n*2-2-1 << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

int main() {
    FAST;

    string s;
    cin >> s;

    int n = s.size(), i, ans = 0;

    bool f = 1;
    for (i = 0; i < n/2; ++i) {
        if (s[i] != s[n-1-i]) {
            f = 0;
            break;
        }
    }

    if (f) {
        cout << 0 << endl;
    } else {
        cout << 3 << endl;
        cout << "R " << n-1 << endl;
        n += n-2;
        cout << "L " << 2   << endl;
        cout << "R " << n-1 << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

int main() {
    FAST;

    string s;
    cin >> s;

    int n = s.size(), i, ans = 0;

    bool f = 1;
    for (i = 0; i < n/2; ++i) {
        if (s[i] != s[n-1-i]) {
            f = 0;
            break;
        }
    }

    if (f) {
        cout << 0 << endl;
    } else {
        cout << 3 << endl;
        cout << "R " << n-1 << endl;
        cout << "L " << 2   << endl;
        cout << "R " << n-1 << endl;
    }

    return 0;
}


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
using namespace std;
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      SRV(v)              sort(v.rbegin(),v.rend())
#define      REV(v)              reverse(v.begin(),v.end())
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      MP                  make_pair
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
constexpr ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=3e5+5;
vector<ll> adj[N];
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------------------START---------------------*/

/*-----*/
void solve(){
   ll n;
   string s,ans;
   V<ll> v;
   cin>>s;
   ll len=s.length();
   ans+='R'; v.PSB(len-1);
   ans+='R'; v.PSB(2);
   ans+='L'; v.PSB(2);
   ans+='R'; v.PSB(2);
   ll bal=2*(len+len)+2;
   ans+='R'; v.PSB(bal-1);
   //ans+='R';
   cout<<"5"<<endl;
   for(ll i=0;i<5;i++)
    cout<<ans[i]<<' '<<v[i]<<endl;

}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////   C O D I N G  I S  L I F E   ///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
using namespace std;
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      SRV(v)              sort(v.rbegin(),v.rend())
#define      REV(v)              reverse(v.begin(),v.end())
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      MP                  make_pair
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
constexpr ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=3e5+5;
vector<ll> adj[N];
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------------------START---------------------*/

/*-----*/
void solve(){
   ll n;
   string s,ans;
   V<ll> v;
   cin>>s;
   ll len=s.length();
   ll x=len+len-1;
   ll bal=x*2+2;
   cout<<"3"<<endl;
   cout<<"L"<<' '<<"2"<<endl;
   //cout<<"R"<<' '<<"3"<<endl;
   cout<<"R"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<len*2-1<<endl;

}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////   C O D I N G  I S  L I F E   ///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
using namespace std;
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      SRV(v)              sort(v.rbegin(),v.rend())
#define      REV(v)              reverse(v.begin(),v.end())
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      MP                  make_pair
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
constexpr ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=3e5+5;
vector<ll> adj[N];
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------------------START---------------------*/

/*-----*/
void solve(){
   ll n;
   string s,ans;
   V<ll> v;
   cin>>s;
   ll len=s.length();
   ll x=len+len-1;
   ll bal=(x-2)*2+2;
   cout<<"4"<<endl;
   cout<<"L"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<"3"<<endl;
   cout<<"R"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<bal<<endl;

}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////   C O D I N G  I S  L I F E   ///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
using namespace std;
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      SRV(v)              sort(v.rbegin(),v.rend())
#define      REV(v)              reverse(v.begin(),v.end())
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      MP                  make_pair
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
constexpr ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=3e5+5;
vector<ll> adj[N];
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------------------START---------------------*/

/*-----*/
void solve(){
   ll n;
   string s,ans;
   V<ll> v;
   cin>>s;
   ll len=s.length();
   ll x=len+len-1;
   ll bal=(x-2)*2+1;
   cout<<"4"<<endl;
   cout<<"L"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<"3"<<endl;
   cout<<"R"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<bal<<endl;

}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////   C O D I N G  I S  L I F E   ///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
using namespace std;
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      SRV(v)              sort(v.rbegin(),v.rend())
#define      REV(v)              reverse(v.begin(),v.end())
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      MP                  make_pair
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
constexpr ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=3e5+5;
vector<ll> adj[N];
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------------------START---------------------*/

/*-----*/
void solve(){
   ll n;
   string s,ans;
   V<ll> v;
   cin>>s;
   ll len=s.length();
   ll bal=2*(len+6)-1;
   cout<<"6"<<endl;
   cout<<"L"<<' '<<"2"<<endl;
   cout<<"L"<<' '<<"3"<<endl;
   cout<<"L"<<' '<<"3"<<endl;
   cout<<"L"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<bal<<endl;

}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////   C O D I N G  I S  L I F E   ///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
using namespace std;
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      SRV(v)              sort(v.rbegin(),v.rend())
#define      REV(v)              reverse(v.begin(),v.end())
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      MP                  make_pair
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
constexpr ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=3e5+5;
vector<ll> adj[N];
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------------------START---------------------*/

/*-----*/
void solve(){
   ll n;
   string s,ans;
   V<ll> v;
   cin>>s;
   ll len=s.length();
   ll x=len+len-1;
   ll bal=x*2+2;
   cout<<"4"<<endl;
   cout<<"L"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<"3"<<endl;
   cout<<"R"<<' '<<"2"<<endl;
   cout<<"R"<<' '<<bal<<endl;

}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////   C O D I N G  I S  L I F E   ///////


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
void solve(){
	string s;cin>>s;
	int n=s.size();

		cout<<"3\n"<<"R "<<n-1<<"\nL "<<n<<"\nL 2\n";

}
int main(){
	solve();
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
void solve(){
	string s;
	scanf("%s",&s);
bool ok=true;
int n=s.size();
	for(int i=0;i<s.size();i++){
		if(s[i]!=s[s.size()-1])
		   ok=false;
	}
	if(ok){
		cout<<0<<endl;
		return;
	}
	else{
		cout<<"3\n"<<"R "<<n-1<<"\nL "<<n<<"\nL 2\n";
	}

}
int main(){
	solve();
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
void solve(){
	string s;
	scanf("%s",&s);
bool ok=true;
	for(int i=0;i<s.size();i++){
		if(s[i]!=s[s.size()-1])
		   ok=false;
	}
	if(ok){
		cout<<0<<endl;
		return;
	}
	else{
		cout<<"1\n"<<"L "<<1<<endl;
	}

}
int main(){
	solve();
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
void solve(){
	string s;cin>>s;

		cout<<"3\n"<<"R "<<n-1<<"\nL "<<n<<"\nL 2\n";

}
int main(){
	solve();
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
void solve(){
	string s;
	scanf("%s",&s);
bool ok=true;
	for(int i=0;i<s.size();i++){
		if(s[i]!=s[n-1])
		   ok=false;
	}
	if(ok){
		cout<<0<<endl;
		return;
	}
	else{
		cout<<"1\n"<<"L "<<1<<endl;
	}

}
int main(){
	solve();
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
void solve(){
	string s;cin>>s;
	int n=s.size();
	bool ok=true;
	for(int i=0;i<n;i++){
		if(s[i]!=s[n-i-1])
		ok=false;
	}
	if(ok)
	cout<<"0\n";
  else
		cout<<"3\n"<<"R "<<n-1<<"\nL "<<n<<"\nL 2\n";

}
int main(){
	solve();
}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
     cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<3<<endl;
        cout<<'R'<<" "<<n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
   //  cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        n=str.size();
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<2*n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
     cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
   //  cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        n=str.size();
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
   //  cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
     cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        n=str.size();
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<2*n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
     cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<2*n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
   //  cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        n=str.size();
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<3<<endl;
        cout<<'R'<<" "<<n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 18 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;
//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    int t=1;
   //  cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>str;
        cout<<3<<endl;
        cout<<'L'<<" "<<2<<endl;
        cout<<'R'<<" "<<3<<endl;
        cout<<'R'<<" "<<n-1<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


#include <bits/stdc++.h>
#define ll long long
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define PI 2 * acos(0)
#define ones(n) __builtin_popcount(n)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX 9000000
#define debug(x) cerr << #x << " = " << x << '\n';
#define LOOP printf("LOOP!!")
#define READ freopen("input.txt", "r", stdin)
#define PRINT freopen("output.txt", "w", stdout);
#define print(a, b) printf("Case %d: %lld\n", a, b)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
using namespace std;
const int MOD = 1000000007;
bool ispalindrome(string &s)
{

    for (int i = 0; i < (int)s.size() / 2; i++)
    {
        if (s[i] == s[(s.size() - i - 1)])
            continue;
        else
            return false;
    }

    return 1;
}
/************MAIN_FUNCTION**********/

int main(int argc, char *argv[])
{

    string s;
    cin >> s;

    if (ispalindrome(s))
    {
        cout << 0 << '\n';
    }

    else
    {
        cout << 2 << '\n';
        cout << 'L' << " " << s.size() - 1 << '\n';
        cout << 'R' << " " << 2 << '\n';
    }
}


#include <bits/stdc++.h>
#define ll long long
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define PI 2 * acos(0)
#define ones(n) __builtin_popcount(n)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX 9000000
#define debug(x) cerr << #x << " = " << x << '\n';
#define LOOP printf("LOOP!!")
#define READ freopen("input.txt", "r", stdin)
#define PRINT freopen("output.txt", "w", stdout);
#define print(a, b) printf("Case %d: %lld\n", a, b)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
using namespace std;
const int MOD = 1000000007;
bool ispalindrome(string &s)
{

    for (int i = 0; i < (int)s.size() / 2; i++)
    {
        if (s[i] == s[(s.size() - i - 1)])
            continue;
        else
            return false;
    }

    return 1;
}
/************MAIN_FUNCTION**********/

int main(int argc, char *argv[])
{

    string s;
    cin >> s;

    if (ispalindrome(s))
    {
        cout << 0 << '\n';
    }

    else
    {
        cout << 3 << '\n';
        cout << 'L' << " " << 2 << '\n';
        cout << 'R' << " " << 2 << '\n';
        cout << 'R' << " " << (2 * (s.size())) - 1 << '\n';
    }
}


#include <bits/stdc++.h>
#define ll long long
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define PI 2 * acos(0)
#define ones(n) __builtin_popcount(n)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX 9000000
#define debug(x) cerr << #x << " = " << x << '\n';
#define LOOP printf("LOOP!!")
#define READ freopen("input.txt", "r", stdin)
#define PRINT freopen("output.txt", "w", stdout);
#define print(a, b) printf("Case %d: %lld\n", a, b)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
using namespace std;
const int MOD = 1000000007;
bool ispalindrome(string &s)
{

    for (int i = 0; i < (int)s.size() / 2; i++)
    {
        if (s[i] == s[(s.size() - i - 1)])
            continue;
        else
            return false;
    }

    return 1;
}
/************MAIN_FUNCTION**********/

int main(int argc, char *argv[])
{

    string s;
    cin >> s;

    if (ispalindrome(s))
    {
        cout << 0 << '\n';
    }

    else
    {
        cout << 3 << '\n';
        cout << 'R' << " " << s.size() - 1 << '\n';
        cout << 'L' << " " << s.size() << '\n';
        cout << 'L' << " " << 2 << '\n';
    }
}


#include <bits/stdc++.h>
#define ll long long
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define PI 2 * acos(0)
#define ones(n) __builtin_popcount(n)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX 9000000
#define debug(x) cerr << #x << " = " << x << '\n';
#define LOOP printf("LOOP!!")
#define READ freopen("input.txt", "r", stdin)
#define PRINT freopen("output.txt", "w", stdout);
#define print(a, b) printf("Case %d: %lld\n", a, b)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
using namespace std;
const int MOD = 1000000007;
bool ispalindrome(string &s)
{

    for (int i = 0; i < (int)s.size() / 2; i++)
    {
        if (s[i] == s[(s.size() - i - 1)])
            continue;
        else
            return false;
    }

    return 1;
}
/************MAIN_FUNCTION**********/

int main(int argc, char *argv[])
{

    string s;
    cin >> s;

    if (ispalindrome(s))
    {
        cout << 0 << '\n';
    }

    else
    {
        cout << 1 << '\n';
        cout << 'L' << " " << s.size() << '\n';
    }
}


#include <bits/stdc++.h>
#define ll long long
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define PI 2 * acos(0)
#define ones(n) __builtin_popcount(n)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX 9000000
#define debug(x) cerr << #x << " = " << x << '\n';
#define LOOP printf("LOOP!!")
#define READ freopen("input.txt", "r", stdin)
#define PRINT freopen("output.txt", "w", stdout);
#define print(a, b) printf("Case %d: %lld\n", a, b)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
using namespace std;
const int MOD = 1000000007;
bool ispalindrome(string &s)
{

    for (int i = 0; i < (int)s.size() / 2; i++)
    {
        if (s[i] == s[(s.size() - i - 1)])
            continue;
        else
            return false;
    }

    return 1;
}
/************MAIN_FUNCTION**********/

int main(int argc, char *argv[])
{

    string s;
    cin >> s;

    if (ispalindrome(s))
    {
        cout << 0 << '\n';
    }

    else
    {
        cout << 1 << '\n';
        cout << 'R' << " " << 1 << '\n';
    }
}


#include <bits/stdc++.h>
#define ll long long
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define PI 2 * acos(0)
#define ones(n) __builtin_popcount(n)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX 9000000
#define debug(x) cerr << #x << " = " << x << '\n';
#define LOOP printf("LOOP!!")
#define READ freopen("input.txt", "r", stdin)
#define PRINT freopen("output.txt", "w", stdout);
#define print(a, b) printf("Case %d: %lld\n", a, b)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
using namespace std;
const int MOD = 1000000007;
bool ispalindrome(string &s)
{

    for (int i = 0; i < (int)s.size() / 2; i++)
    {
        if (s[i] == s[(s.size() - i - 1)])
            continue;
        else
            return false;
    }

    return 1;
}
/************MAIN_FUNCTION**********/

int main(int argc, char *argv[])
{

    string s;
    cin >> s;

    if (ispalindrome(s))
    {
        cout << 0 << '\n';
    }

    else
    {
        cout << 2 << '\n';
        cout << 'R' << " " << s.size() - 1 << '\n';
        cout << 'L' << " " << s.size() << '\n';
    }
}


#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define N 1000005
#define en cout << endl
#define sp cout << " "
//#define f(i,a,b)  for(int i=a;i<b;i++)
#define precision(x) cout << fixed << setprecision(x);
#define fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
    {
        string str;
        cin>>str;
        int n = str.size();

    // table[i][j] will be false if substring
    // str[i..j] is not palindrome.
    // Else table[i][j] will be true
    bool table[n][n];

    memset(table, 0, sizeof(table));

    // All substrings of length 1
    // are palindromes
    int maxLength = 1;

    for (int i = 0; i < n; ++i)
        table[i][i] = true;

    // check for sub-string of length 2.
    int start = 0;
    for (int i = 0; i < n - 1; ++i) {
        if (str[i] == str[i + 1]) {
            table[i][i + 1] = true;
            start = i;
            maxLength = 2;
        }
    }

    // Check for lengths greater than 2.
    // k is length of substring
    for (int k = 3; k <= n; ++k) {
        // Fix the starting index
        for (int i = 0; i < n - k + 1; ++i) {
            // Get the ending index of substring from
            // starting index i and length k
            int j = i + k - 1;

            // checking for sub-string from ith index to
            // jth index iff str[i+1] to str[j-1] is a
            // palindrome
            if (table[i + 1][j - 1] && str[i] == str[j]) {
                table[i][j] = true;

                if (k > maxLength) {
                    start = i;
                    maxLength = k;
                }
            }
        }
    }
    cout<<2<<endl;
    if(start==0)
    {
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n+n-maxLength<<endl;
    }
    else
    {
        cout<<'L'<<" "<<n-1<<endl;
        cout<<'L'<<" "<<2<<endl;
    }
    }
    return 0;
}


#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define N 1000005
#define en cout << endl
#define sp cout << " "
//#define f(i,a,b)  for(int i=a;i<b;i++)
#define precision(x) cout << fixed << setprecision(x);
#define fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
    {
        string str;
        cin>>str;
        int n = str.size();

    // table[i][j] will be false if substring
    // str[i..j] is not palindrome.
    // Else table[i][j] will be true
    bool table[n][n];

    memset(table, 0, sizeof(table));

    // All substrings of length 1
    // are palindromes
    int maxLength = 1;

    for (int i = 0; i < n; ++i)
        table[i][i] = true;

    // check for sub-string of length 2.
    int start = 0;
    for (int i = 0; i < n - 1; ++i) {
        if (str[i] == str[i + 1]) {
            table[i][i + 1] = true;
            start = i;
            maxLength = 2;
        }
    }

    // Check for lengths greater than 2.
    // k is length of substring
    for (int k = 3; k <= n; ++k) {
        // Fix the starting index
        for (int i = 0; i < n - k + 1; ++i) {
            // Get the ending index of substring from
            // starting index i and length k
            int j = i + k - 1;

            // checking for sub-string from ith index to
            // jth index iff str[i+1] to str[j-1] is a
            // palindrome
            if (table[i + 1][j - 1] && str[i] == str[j]) {
                table[i][j] = true;

                if (k > maxLength) {
                    start = i;
                    maxLength = k;
                }
            }
        }
    }
    if(maxLength==n)
    {
        cout<<0<<endl;
        return 0;
    }
    cout<<2<<endl;
    if(start==0)
    {
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n+n-maxLength<<endl;
    }
    else
    {
        cout<<'L'<<" "<<n-1<<endl;
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n+maxLength-1+n+maxLength-1+n+maxLength-2<<endl;
    }
    }
    return 0;
}


#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define N 1000005
#define en cout << endl
#define sp cout << " "
//#define f(i,a,b)  for(int i=a;i<b;i++)
#define precision(x) cout << fixed << setprecision(x);
#define fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
    {
        string str;
        cin>>str;
        int n = str.size();

    // table[i][j] will be false if substring
    // str[i..j] is not palindrome.
    // Else table[i][j] will be true
    bool table[n][n];

    memset(table, 0, sizeof(table));

    // All substrings of length 1
    // are palindromes
    int maxLength = 1;

    for (int i = 0; i < n; ++i)
        table[i][i] = true;

    // check for sub-string of length 2.
    int start = 0;
    for (int i = 0; i < n - 1; ++i) {
        if (str[i] == str[i + 1]) {
            table[i][i + 1] = true;
            start = i;
            maxLength = 2;
        }
    }

    // Check for lengths greater than 2.
    // k is length of substring
    for (int k = 3; k <= n; ++k) {
        // Fix the starting index
        for (int i = 0; i < n - k + 1; ++i) {
            // Get the ending index of substring from
            // starting index i and length k
            int j = i + k - 1;

            // checking for sub-string from ith index to
            // jth index iff str[i+1] to str[j-1] is a
            // palindrome
            if (table[i + 1][j - 1] && str[i] == str[j]) {
                table[i][j] = true;

                if (k > maxLength) {
                    start = i;
                    maxLength = k;
                }
            }
        }
    }
    if(maxLength==n)
    {
        cout<<0<<endl;
        return 0;
    }
    cout<<2<<endl;
    if(start==0)
    {
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n+1<<endl;
    }
    else
    {
        cout<<'L'<<" "<<n-1<<endl;
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<2*n-1<<endl;
    }
    }
    return 0;
}


// THIS IS ALL A MOO POINT
#include<bits/stdc++.h>
using namespace std;
#define int       long long
#define mp        make_pair
#define pb        push_back
#define ppb       pop_back
#define pii       pair<int,int>
#define F         first
#define S         second
#define endl      '\n'
#define f(i,a,b)  for(int i=a;i<b;i++)
#define all(v)    v.begin(), v.end()

void solve()
{
    string s;
    cin>>s;
    int n=s.length();
    cout<<3<<endl;
    cout<<"L 2"<<endl;
    cout<<"R 2"<<endl;
    cout<<"R"<<" "<<2*n-1<<endl;
}

signed main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
    solve();
    return 0;
}


#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define N 1000005
#define en cout << endl
#define sp cout << " "
//#define f(i,a,b)  for(int i=a;i<b;i++)
#define precision(x) cout << fixed << setprecision(x);
#define fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
    {
        string str;
        cin>>str;
        int n = str.size();

    // table[i][j] will be false if substring
    // str[i..j] is not palindrome.
    // Else table[i][j] will be true
    bool table[n][n];

    memset(table, 0, sizeof(table));

    // All substrings of length 1
    // are palindromes
    int maxLength = 1;

    for (int i = 0; i < n; ++i)
        table[i][i] = true;

    // check for sub-string of length 2.
    int start = 0;
    for (int i = 0; i < n - 1; ++i) {
        if (str[i] == str[i + 1]) {
            table[i][i + 1] = true;
            start = i;
            maxLength = 2;
        }
    }

    // Check for lengths greater than 2.
    // k is length of substring
    for (int k = 3; k <= n; ++k) {
        // Fix the starting index
        for (int i = 0; i < n - k + 1; ++i) {
            // Get the ending index of substring from
            // starting index i and length k
            int j = i + k - 1;

            // checking for sub-string from ith index to
            // jth index iff str[i+1] to str[j-1] is a
            // palindrome
            if (table[i + 1][j - 1] && str[i] == str[j]) {
                table[i][j] = true;

                if (k > maxLength) {
                    start = i;
                    maxLength = k;
                }
            }
        }
    }
    if(start==0)
    {
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n+n-maxLength<<endl;
    }
    else
    {
        cout<<'L'<<" "<<n-1<<endl;
        cout<<'L'<<" "<<2<<endl;
    }
    }
    return 0;
}


#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define N 1000005
#define en cout << endl
#define sp cout << " "
//#define f(i,a,b)  for(int i=a;i<b;i++)
#define precision(x) cout << fixed << setprecision(x);
#define fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
    {
        string str;
        cin>>str;
        int n = str.size();

    // table[i][j] will be false if substring
    // str[i..j] is not palindrome.
    // Else table[i][j] will be true
    bool table[n][n];

    memset(table, 0, sizeof(table));

    // All substrings of length 1
    // are palindromes
    int maxLength = 1;

    for (int i = 0; i < n; ++i)
        table[i][i] = true;

    // check for sub-string of length 2.
    int start = 0;
    for (int i = 0; i < n - 1; ++i) {
        if (str[i] == str[i + 1]) {
            table[i][i + 1] = true;
            start = i;
            maxLength = 2;
        }
    }

    // Check for lengths greater than 2.
    // k is length of substring
    for (int k = 3; k <= n; ++k) {
        // Fix the starting index
        for (int i = 0; i < n - k + 1; ++i) {
            // Get the ending index of substring from
            // starting index i and length k
            int j = i + k - 1;

            // checking for sub-string from ith index to
            // jth index iff str[i+1] to str[j-1] is a
            // palindrome
            if (table[i + 1][j - 1] && str[i] == str[j]) {
                table[i][j] = true;

                if (k > maxLength) {
                    start = i;
                    maxLength = k;
                }
            }
        }
    }
    if(maxLength==n)
    {
        cout<<0<<endl;
        return 0;
    }
    cout<<2<<endl;
    if(start==0)
    {
        cout<<'R'<<" "<<2<<endl;
        cout<<'R'<<" "<<n+1<<endl;
    }
    else
    {
        cout<<'L'<<" "<<n-1<<endl;
        cout<<'L'<<" "<<2<<endl;
        //cout<<'R'<<" "<<2*n<<endl;
    }
    }
    return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n;
    cin >> n;

    int    i, ch[n];

    for (i = 0; i < n; i++)
        ch[i] = 0;

    int    j;
    bool   b;
    string       s[n], out[n];

    for (i = 0; i < n; i++)
    {
        cin >> s[i];

        if (i == 0)
            out[i] = "OK";
        else
        {
            b = true;

            for (j = 0; j < i; j++)
                if (s[j] == s[i])
                {
                    ch[j]++;

                    out[i] = s[i] + to_string(ch[j]);

                    b = false;

                    break;
                }

            if (b == true)
                out[i] = "OK";
        }
    }

    for (i = 0; i < n; i++)
        cout << out[i] << endl;

    return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n;
    cin >> n;

    int    i, j, ch[100001];
    bool   b;
    string s[100001], out[100001];

    for (i = 0; i < n; i++)
    {
        cin >> s[i];

        ch[i] = 0;

        if (i == 0)
            out[i] = "OK";
        else
        {
            b = true;

            for (j = 0; j < i; j++)
                if (s[j] == s[i])
                {
                    ch[j]++;

                    out[i] = s[i] + to_string(ch[j]);

                    b = false;

                    break;
                }

            if (b == true)
                out[i] = "OK";
        }
    }

    for (i = 0; i < n; i++)
        cout << out[i] << endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <map>

using namespace std;

int main()
{
    int n;
    scanf("%d\n",&n);

    char             request[32];
    map<string, int> names;
    for (int i(1); i <= n; ++i)
    {
        gets(request);

        if (names[request] == 0)
        {
            cout << "OK" << endl;
            ++names[request];
        }
        else
        {
            cout << request << names[request] << endl;
            ++names[request];
        }
    }

    return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n;
    cin >> n;

    int    i, j, ch[n];
    bool   b;
    string s[n], out[n];

    for (i = 0; i < n; i++)
    {
        cin >> s[i];

        ch[i] = 0;

        if (i == 0)
            out[i] = "OK";
        else
        {
            b = true;

            for (j = 0; j < i; j++)
                if (s[j] == s[i])
                {
                    ch[j]++;

                    out[i] = s[i] + to_string(ch[j]);

                    b = false;

                    break;
                }

            if (b == true)
                out[i] = "OK";
        }
    }

    for (i = 0; i < n; i++)
        cout << out[i] << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p1=1;
    int p2=1;
    int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-97)*p1)%M+((s[i]-97)*p2)%M;
        temphash=temphash%M;
        p1=p1*31;
        p2=p2*37;
    }

    p1=1;
    for(int i=s.size()-1;i>=0;i--)
    {
        temphash+=((s[i]-97)*p1)%M+((s[i]-97)*p2)%M;
        temphash=temphash%M;
        p1=p1*31;
        p2=p2*37;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p=1;
    int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=(s[i]*p)%M;
        temphash=temphash%M;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
map<string,long long int>m;

int main()
{
    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        if(!m.count(s))
        {
            m.insert(pair<string,int>(s,1));
            cout << "OK\n";
        }
        else
        {
            auto it=m.find(s);
            long long int temp=it->second;
            m.erase(it);
            cout << s << temp << "\n";
            m.insert(pair<string,int>(s,temp+1));
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<long long int>ht;

void hashfunc(string s)
{
    long long int p1=1;
    long long int p2=1;
    long long int temphash=0;

    for(long long int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-97)*p1)%M+((s[i]-97)*p2)%M;
        temphash=temphash%M;
        p1=(p1*31)%M;
        p2=(p2*37)%M;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(long long int i=0;i<M;i++)
        ht.push_back(0);

    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p=1;
    int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=(s[i]*p)%M;
        temphash=temphash%M;
        p=p*2;
    }

    p=1;
    for(int i=s.size()-1;i>=0;i--)
    {
        temphash+=(s[i]*p)%M;
        temphash=temphash%M;
        p=p*3;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<long long int>ht;

void hashfunc(string s)
{
    // first hash
    long long int p1=1;
    long long int temphash=0;
    for(long long int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-'a'+1)*p1)%M;
        temphash=temphash%M;
        p1=(p1*31)%M;
    }

    // second hash
    // long long int p2=1;
    long long int temphash2=0;
    // for(long long int i=0;i<s.size();i++)
    // {
    //     temphash2+=((s[i]-'a'+1)*p2)%M;
    //     temphash2=temphash2%M;
    //     p2=(p2*37)%M;
    // }

    ht[temphash+temphash2]++;

    if(ht[temphash+temphash2]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash+temphash2]-1) << "\n";
}

int main()
{
    for(long long int i=0;i<2*M;i++)
        ht.push_back(0);

    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p=1;
    int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=(s[i]*p)%M;
        temphash=temphash%M;
        p=p*2;
    }
    p=1;
    for(int i=s.size()-1;i>=0;i--)
    {
        temphash+=(s[i]*p)%M;
        temphash=temphash%M;
        p=p*2;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
map<string,long long int>m;

int main()
{
    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        if(!m.count(s))
        {
            m.insert(pair<string,int>(s,1));
            cout << "OK\n";
        }
        else
        {
            auto it=m.find(s);
            cout << s << it->second << "\n";
            m.insert(pair<string,int>(s,it->second+1));
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<long long int>ht;

void hashfunc(string s)
{
    long long int p1=1;
    long long int p2=1;
    long long int temphash=0;

    for(long long int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-'a'+1)*p1)%M;
        temphash+=((s[i]-'a'+1)*p2)%M;
        temphash=temphash%M;
        p1=(p1*31)%M;
        p2=(p2*37)%M;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(long long int i=0;i<M;i++)
        ht.push_back(0);

    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<long long int>ht;

void hashfunc(string s)
{
    long long int p1=1;
    long long int p2=1;
    long long int temphash=0;
    for(long long int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-97)*p1)%M+((s[i]-97)*p2)%M;
        temphash=temphash%M;
        p1=p1*31;
        p2=p2*37;
    }

    p1=1;
    p2=1;
    for(long long int i=s.size()-1;i>=0;i--)
    {
        temphash+=((s[i]-97)*p1)%M+((s[i]-97)*p2)%M;
        temphash=temphash%M;
        p1=p1*31;
        p2=p2*37;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(long long int i=0;i<M;i++)
        ht.push_back(0);

    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<long long int>ht;

void hashfunc(string s)
{
    long long int p1=1;
    long long int p2=1;
    long long int temphash=0;

    for(long long int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-97)*p1)%M+((s[s.size()-1-i]-97)*p2)%M;
        temphash=temphash%M;
        p1=(p1*31)%M;
        p2=(p2*37)%M;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(long long int i=0;i<M;i++)
        ht.push_back(0);

    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<long long int>ht;

void hashfunc(string s)
{
    long long int p1=1;
    long long int p2=1;
    long long int temphash=0;

    for(long long int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-97)*p1)%M+(i*((s[s.size()-1-i]-97)*p2))%M;
        temphash=temphash%M;
        p1=(p1*31)%M;
        p2=(p2*37)%M;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(long long int i=0;i<M;i++)
        ht.push_back(0);

    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p1=1;
    int p2=1;
    int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=(((s[i]-97)*p1)%M)*(((s[i]-97)*p2)%M);
        temphash=temphash%M;
        p1=p1*2;
        p2=p2*3;
    }

    p1=1;
    p2=1;
    for(int i=s.size()-1;i>=0;i--)
    {
        temphash+=(((s[i]-97)*p1)%M)*(((s[i]-97)*p2)%M);
        temphash=temphash%M;
        p1=p1*2;
        p2=p2*3;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p=1;
    int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-97)*p)%M;
        temphash=temphash%M;
        p=p*2;
    }

    p=1;
    for(int i=s.size()-1;i>=0;i--)
    {
        temphash+=((s[i]-97)*p)%M;
        temphash=temphash%M;
        p=p*2;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<long long int>ht;

void hashfunc(string s)
{
    // first hash
    long long int p1=1;
    long long int temphash=0;
    for(long long int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-'a'+1)*p1)%M;
        temphash=temphash%M;
        p1=(p1*31)%M;
    }

    // second hash
    long long int p2=1;
    long long int temphash2=0;
    for(long long int i=0;i<s.size();i++)
    {
        temphash2+=((s[i]-'a'+1)*p2)%M;
        temphash2=temphash2%M;
        p2=(p2*37)%M;
    }

    ht[temphash+temphash2]++;

    if(ht[temphash+temphash2]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash+temphash2]-1) << "\n";
}

int main()
{
    for(long long int i=0;i<2*M;i++)
        ht.push_back(0);

    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p1=1;
    int p2=1;
    int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-97)*p1)%M+((s[i]-97)*p2)%M;
        temphash=temphash%M;
        p1=p1*31;
        p2=p2*37;
    }

    p1=1;
    p2=1;
    for(int i=s.size()-1;i>=0;i--)
    {
        temphash+=((s[i]-97)*p1)%M+((s[i]-97)*p2)%M;
        temphash=temphash%M;
        p1=p1*31;
        p2=p2*37;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p=1;
    int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=(s[i]*p)%M;
        temphash=temphash%M;
    }
    for(int i=s.size()-1;i>=0;i--)
    {
        temphash+=(s[i]*p)%M;
        temphash=temphash%M;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<int>ht;

void hashfunc(string s)
{
    int p1=1;
    int p2=1;
    long long int temphash=0;
    for(int i=0;i<s.size();i++)
    {
        temphash+=(((s[i]-97)*p1)%M)*(((s[i]-97)*p2)%M);
        temphash=temphash%M;
        p1=p1*2;
        p2=p2*3;
    }

    p1=1;
    p2=1;
    for(int i=s.size()-1;i>=0;i--)
    {
        temphash+=(((s[i]-97)*p1)%M)*(((s[i]-97)*p2)%M);
        temphash=temphash%M;
        p1=p1*2;
        p2=p2*3;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(int i=0;i<M;i++)
        ht.push_back(0);

    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
# define M 100003
vector<long long int>ht;

void hashfunc(string s)
{
    long long int p1=1;
    long long int p2=1;
    long long int temphash=0;

    for(long long int i=0;i<s.size();i++)
    {
        temphash+=((s[i]-97)*p1)%M+(i*((s[s.size()-1-i]-97)*p2))%M;
        temphash=temphash%M;
        p1=(p1*31)%M;
        p2=(p2*37)%M;
    }

    for(long long int i=s.size()-1;i>=0;i--)
    {
        temphash+=((s[i]-97)*p1)%M+(i*((s[s.size()-1-i]-97)*p2))%M;
        temphash=temphash%M;
        p1=(p1*31)%M;
        p2=(p2*37)%M;
    }

    ht[temphash]++;

    if(ht[temphash]==1)
        cout << "OK\n";
    else
        cout << s+to_string(ht[temphash]-1) << "\n";
}

int main()
{
    for(long long int i=0;i<M;i++)
        ht.push_back(0);

    long long int n;
    cin >> n;
    for(long long int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        hashfunc(s);
    }
    return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
char st[1000001][101];
int n,i,j,a[1000001],e;
int main() {
	scanf("%d",&n);
	i=0;
	while(i<n) {
		i++;
		j=i;
		e=0;
		scanf("%s",&st[i]);
		while(j>1&&e==0) {
			j--;
			if(strcmp(st[i],st[j])==0)
			e=1;
		}
		if(e==1) {
			a[i]=a[j]+1;
		}
		else a[i]=0;
	}
	for(i=1; i<=n; i++) {
		if(a[i]==0) printf("OK\n");
		else 		printf("%s%d\n",st[i],a[i]);
	}
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int i, n, j, e, bit[100001];

int main() {
	cin >> n;
	string s;
	map < string, int> bit;
	while(i < n) {
		i++;
		cin >> s;
		if(bit[s] == 0) {
			cout << "OK" << endl;
			bit[s] ++;
		}
		else {
			cout << s << bit[s] << endl;
			bit[s] ++;
		}
	}
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
char st[10001][1001];
int n,i,j,a[10001],e;
int main() {
	scanf("%d",&n);
	i=0;
	while(i<n) {
		i++;
		j=i;
		e=0;
		scanf("%s",&st[i]);
		while(j>1&&e==0) {
			j--;
			if(strcmp(st[i],st[j])==0)
			e=1;
		}
		if(e==1) {
			a[i]=a[j]+1;
		}
		else a[i]=0;
	}
	for(i=1; i<=n; i++) {
		if(a[i]==0) printf("OK\n");
		else 		printf("%s%d\n",st[i],a[i]);
	}
	return 0;
}


#include <iostream>
#include <cstring>

using namespace std;

char st[100001][50];
int i, n, j, e, a[100001];

int main() {
	cin >> n;
	while(i < n) {
		i++;
		cin >> st[i];
		e = 0;
		for(int j = i - 1; j >= 1; j--)
			if(strcmp(st[i], st[j]) == 0) {
				a[i] = a[j] + 1;
				cout << st[i] << a[i] << endl;
				e = 1;
				break;
			}
		if(e == 0) cout << "OK" << endl;
	}
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
char st[600001][101];
int n,i,j,a[600001],e;
int main() {
	scanf("%d",&n);
	i=0;
	while(i<n) {
		i++;
		j=i;
		e=0;
		scanf("%s",&st[i]);
		while(j>1&&e==0) {
			j--;
			if(strcmp(st[i],st[j])==0)
			e=1;
		}
		if(e==1) {
			a[i]=a[j]+1;
		}
		else a[i]=0;
	}
	for(i=1; i<=n; i++) {
		if(a[i]==0) printf("OK\n");
		else 		printf("%s%d\n",st[i],a[i]);
	}
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
char st[100001][101];
int a[100001]={0},i,j,n,l1,l2;
int main() {
	scanf("%d",&n);
	i=0;
	while(i<n)	{
		i++;
		scanf("%s",&st[i]);
		for(j=i-1; j>0; j--) {
			l1=strlen(st[i]);
			l2=strlen(st[j]);
			if(strcmp(st[j],st[i])==0&&l1==l2) {
				a[i]=a[j]+1;
				break;
			}
		}
	}
	i=0;
	while(i<n) {
		i++;
		if(a[i]==0) printf("OK\n");
		else 	 	printf("%s%d\n",st[i],a[i]);
	}
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
char st[100001][101];
int a[10001]={0},i,j,n,l1,l2;
int main() {
	scanf("%d",&n);
	i=0;
	while(i<n)	{
		i++;
		scanf("%s",&st[i]);
		for(j=i-1; j>0; j--) {
			l1=strlen(st[i]);
			l2=strlen(st[j]);
			if(strcmp(st[j],st[i])==0&&l1==l2) {
				a[i]=a[j]+1;
				break;
			}
		}
	}
	i=0;
	while(i<n) {
		i++;
		if(a[i]==0) printf("OK\n");
		else 	 	printf("%s%d\n",st[i],a[i]);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
void solve(vector<string>v)
{
unordered_set<string>st;
int j=1;
for(int i=0;i<v.size();i++)
{
     if(st.find(v[i])!=st.end())
     {
     cout<<v[i]<<j<<endl;
     j++;
     }
     else
     {
     cout<<"OK"<<endl;
     st.insert(v[i]);
     }
}
}
int main()
{
     vector<string>v;
     string s;
     cin>>s;
     v.push_back(s);
     solve(v);
     return 0;
}


#include <bits/stdc++.h>
using namespace std;
void solve(vector<string>v)
{
unordered_set<string>st;
for(int i=0;i<v.size();i++)
{
     if(st.find(v[i])!=v.end())
     cout<<v[i]<<j<<endl;
     else
     cout<<"OK"<<endl;
}
}
int main()
{
     vector<string>v;
     string s;
     cin>>s;
     v.push_back(s);
     solve(s);
     return 0;
}


#include <bits/stdc++.h>
using namespace std;
void solve(vector<string>v)
{
unordered_set<string>st;
for(int i=0;i<v.size();i++)
{
     int j=1;
     if(st.find(v[i])!=st.end())
     {
     cout<<v[i]<<j<<endl;
     j++;
     }
     else
     {
     cout<<"OK"<<endl;
     st.insert(v[i]);
     }
}
}
int main()
{
     int n;
     cin>>n;
     vector<string>v;
     while(n--)
     {
     string s;
     cin>>s;
     v.push_back(s);
     }
     solve(v);
     return 0;
}


#include <bits/stdc++.h>
using namespace std;
void solve(vector<string>v)
{
unordered_set<string>st;
int j=1;
for(int i=0;i<v.size();i++)
{

     if(st.find(v[i])!=st.end())
     {
     cout<<v[i]<<j<<endl;
     j++;
     }
     else
     {
     cout<<"OK"<<endl;
     st.insert(v[i]);
     }
}
}
int main()
{
     int n;
     cin>>n;
     vector<string>v;
     while(n--)
     {
     string s;
     cin>>s;
     v.push_back(s);
     }
     solve(v);
     return 0;
}


#include <bits/stdc++.h>
using namespace std;
void solve(vector<string>v)
{
unordered_map<string,int>mp;

for(int i=0;i<v.size();i++)
{
     if(mp.find(v[i])!=mp.end())
     {
          cout<<v[i]<<mp[v[i]]<<endl;
     }
     else
     {
     cout<<"OK"<<endl;
     mp[v[i]]++;
     }
}
}
int main()
{
     int n;
     cin>>n;
     vector<string>v;
     while(n--)
     {
     string s;
     cin>>s;
     v.push_back(s);
     }
     solve(v);
     return 0;
}


#include <bits/stdc++.h>
using namespace std;
void solve(vector<string>v)
{
unordered_set<string>st;
int j=1;
for(int i=0;i<v.size();i++)
{
     if(st.find(v[i])!=st.end())
     {
     cout<<v[i]<<j<<endl;
     j++;
     }
     else
     {
     cout<<"OK"<<endl;
     st.insert(v[i]);
     }
}
}
int main()
{
     vector<string>v;
     string s;
     cin>>s;
     v.push_back(s);
     solve(s);
     return 0;
}


#include <bits/stdc++.h>
using namespace std;
void solve(vector<string>v)
{
unordered_map<string,int>mp;

for(int i=0;i<v.size();i++)
{
     if(mp.find(v[i])!=st.end())
     {
          cout<<v[i]<<mp[v[i]]<<endl;
     }
     else
     {
     cout<<"OK"<<endl;
     mp[v[i]]++;
     }
}
}
int main()
{
     int n;
     cin>>n;
     vector<string>v;
     while(n--)
     {
     string s;
     cin>>s;
     v.push_back(s);
     }
     solve(v);
     return 0;
}