#include<bits/stdc++.h>
using namespace std;
string s;
string t;
int dp[2105];
pair<int,int> so[2105];
int trie[4412105][27];
pair<int,int>seg[4412105];
int cur=1;
void print(int j)
{
    int i=j-(abs(so[j].second-so[j].first)+1)+1;
    if(i==0)
    {
        printf("%d %d\n",so[j].first+1,so[j].second+1);
        return;
    }
    print(i-1);
    printf("%d %d\n",so[j].first+1,so[j].second+1);
}
int main()
{
    for(int i=0;i<2105;i++)dp[i]=(1<<30);
    cin>>s>>t;
    for(int i=0;i<s.length();i++)
    {
        int v=1;
        for(int j=i;j<s.length();j++)
        {
            if(trie[v][s[j]-'a']==0)
            {
                cur++;
                seg[cur]=make_pair(i,j);
                trie[v][s[j]-'a']=cur;
                v=cur;
            }
            else
                v=trie[v][s[j]-'a'];
        }
        v=1;
        for(int j=i;j>=0;j--)
        {
            if(trie[v][s[j]-'a']==0)
            {
                cur++;
                seg[cur]=make_pair(i,j);
                trie[v][s[j]-'a']=cur;
                v=cur;
            }
            else
                v=trie[v][s[j]-'a'];
        }
    }
    for(int i=0;i<t.length();i++)
    {
        int v=1;
        for(int j=i;j<t.length();j++)
        {
            if(trie[v][t[j]-'a']==0)break;
            else
            {
                v=trie[v][t[j]-'a'];
                if(i==0)
                {
                    dp[j]=1;
                    so[j]=seg[v];
                }
                else
                {
                    if(dp[j]>dp[i-1]+1)
                    {
                        dp[j]=dp[i-1]+1;
                        so[j]=seg[v];
                    }
                }
            }
        }
    }
    if(dp[t.length()-1]==(1<<30))
        puts("-1");
    else
    {
        printf("%d\n",dp[t.length()-1]);
        print(t.length()-1);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string s;
string t;
int dp[2105];
pair<int,int> so[2105];
int trie[3207055][27];
pair<int,int>seg[3207055];
int cur=1;
void print(int j)
{
    int i=j-(abs(so[j].second-so[j].first)+1)+1;
    if(i==0)
    {
        printf("%d %d\n",so[j].first+1,so[j].second+1);
        return;
    }
    print(i-1);
    printf("%d %d\n",so[j].first+1,so[j].second+1);
}
int main()
{
    for(int i=0;i<2105;i++)dp[i]=(1<<30);
    cin>>s>>t;
    for(int i=0;i<s.length();i++)
    {
        int v=1;
        for(int j=i;j<s.length();j++)
        {
            if(trie[v][s[j]-'a']==0)
            {
                cur++;
                seg[cur]=make_pair(i,j);
                trie[v][s[j]-'a']=cur;
                v=cur;
            }
            else
                v=trie[v][s[j]-'a'];
        }
        v=1;
        for(int j=i;j>=0;j--)
        {
            if(trie[v][s[j]-'a']==0)
            {
                cur++;
                seg[cur]=make_pair(i,j);
                trie[v][s[j]-'a']=cur;
                v=cur;
            }
            else
                v=trie[v][s[j]-'a'];
        }
    }
    for(int i=0;i<t.length();i++)
    {
        int v=1;
        for(int j=i;j<t.length();j++)
        {
            if(trie[v][t[j]-'a']==0)break;
            else
            {
                v=trie[v][t[j]-'a'];
                if(i==0)
                {
                    dp[j]=1;
                    so[j]=seg[v];
                }
                else
                {
                    if(dp[j]>dp[i-1]+1)
                    {
                        dp[j]=dp[i-1]+1;
                        so[j]=seg[v];
                    }
                }
            }
        }
    }
    if(dp[t.length()-1]==(1<<30))
        puts("-1");
    else
    {
        printf("%d\n",dp[t.length()-1]);
        print(t.length()-1);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string s,t;
long long p[3005];
long long num=43;
long long mod=(1<<12)+7;
map<long long,pair<int,int> >se;
int dp[3005];
pair<int,int>so[3005];
void print(int j)
{
    int l=j-(abs(so[j].second-so[j].first)+1);
    if(l+1==0)
    {
        printf("%d %d\n",so[j].first+1,so[j].second+1);
        return;
    }
    else
    {
        print(l);
        printf("%d %d\n",so[j].first+1,so[j].second+1);
        j=l;
    }
}
int main()
{
    for(int i=0;i<3005;i++)dp[i]=1000000000;
    p[0]=1;
    for(int i=1;i<3005;i++)
        p[i]=(num*p[i-1])%mod;
    cin>>s>>t;
    for(int i=0;i<s.length();i++)
    {
        long long hash=0;
        for(int j=i;j<s.length();j++)
        {
            hash=(hash+(p[j-i]*((s[j]-'a')+1))%mod)%mod;
            se[hash]=make_pair(i,j);
        }
        hash=0;
        for(int j=i;j>=0;j--)
        {
            hash=(hash+(p[i-j]*((s[j]-'a')+1))%mod)%mod;
            se[hash]=make_pair(i,j);
        }
    }
    for(int i=0;i<t.length();i++)
    {
        long long hash=0;
        int l=0;
        for(int j=i;j>=0;j--)
        {
            hash=((hash*num)%mod+(((t[j]-'a')+1)))%mod;
            map<long long,pair<int,int> >::iterator it=se.find(hash);
            if(it!=se.end())
            {
                if(j==0)
                {
                    dp[i]=1;
                    so[i]=make_pair(it->second.first,it->second.second);
                }
                else
                {
                    if(dp[j-1]+1<dp[i])
                    {
                        so[i]=make_pair(it->second.first,it->second.second);
                        dp[i]=dp[j-1]+1;
                    }
                }
            }
        }
    }
    if(dp[t.length()-1]==1000000000)
        puts("-1");
    else
    {
        printf("%d\n",dp[t.length()-1]);
        print(t.length()-1);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string s,t;
long long p[3005];
long long num=43;
long long mod=(1<<12)+7;
map<long long,pair<int,int> >se;
int dp[3005];
pair<int,int>so[3005];
void print(int j)
{
       int l=j-(abs(so[j].second-so[j].first)+1);
    if(l+1==0)
    {
        printf("%d %d\n",so[j].first+1,so[j].second+1);
        return;
    }
    else
    {
        print(l);
        printf("%d %d\n",so[j].first+1,so[j].second+1);
        j=l;
    }
}
int main()
{
    for(int i=0;i<3005;i++)dp[i]=1000000000;
    p[0]=1;
    for(int i=1;i<3005;i++)
        p[i]=(num*p[i-1])%mod;
    cin>>s>>t;
    for(int i=0;i<s.length();i++)
    {
        long long hash=0;
        for(int j=i;j<s.length();j++)
        {
            hash=(hash+(p[j-i]*((s[j]-'a')+1)))%mod;
            se[hash]=make_pair(i,j);
        }
        hash=0;
        for(int j=i;j>=0;j--)
        {
            hash=(hash+(p[i-j]*((s[j]-'a')+1)))%mod;
            se[hash]=make_pair(i,j);
        }
    }
    for(int i=0;i<t.length();i++)
    {
        long long hash=0;
        int l=0;
        for(int j=i;j>=0;j--)
        {
            hash=((hash*num)+((t[j]-'a'+1)))%mod;
            map<long long,pair<int,int> >::iterator it=se.find(hash);
            if(it!=se.end())
            {
                if(j==0)
                {
                    dp[i]=1;
                    so[i]=make_pair(it->second.first,it->second.second);
                }
                else
                {
                    if(dp[j-1]+1<dp[i])
                    {
                        so[i]=make_pair(it->second.first,it->second.second);
                        dp[i]=min(dp[i],dp[j-1]+1);
                    }
                }
            }
        }
    }
    if(dp[t.length()-1]==1000000000)
        puts("-1");
    else
    {
        printf("%d\n",dp[t.length()-1]);
        print(t.length()-1);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string s;
string t;
int dp[2105];
pair<int,int> so[2105];
int trie[2207055][27];
pair<int,int>seg[2207055];
int cur=1;
void print(int j)
{
    int i=j-(abs(so[j].second-so[j].first)+1)+1;
    if(i==0)
    {
        printf("%d %d\n",so[j].first+1,so[j].second+1);
        return;
    }
    print(i-1);
    printf("%d %d\n",so[j].first+1,so[j].second+1);
}
int main()
{
    for(int i=0;i<2105;i++)dp[i]=(1<<30);
    cin>>s>>t;
    for(int i=0;i<s.length();i++)
    {
        int v=1;
        for(int j=i;j<s.length();j++)
        {
            if(trie[v][s[j]-'a']==0)
            {
                cur++;
                seg[cur]=make_pair(i,j);
                trie[v][s[j]-'a']=cur;
                v=cur;
            }
            else
                v=trie[v][s[j]-'a'];
        }
        v=1;
        for(int j=i;j>=0;j--)
        {
            if(trie[v][s[j]-'a']==0)
            {
                cur++;
                seg[cur]=make_pair(i,j);
                trie[v][s[j]-'a']=cur;
                v=cur;
            }
            else
                v=trie[v][s[j]-'a'];
        }
    }
    for(int i=0;i<t.length();i++)
    {
        int v=1;
        for(int j=i;j<t.length();j++)
        {
            if(trie[v][t[j]-'a']==0)break;
            else
            {
                v=trie[v][t[j]-'a'];
                if(i==0)
                {
                    dp[j]=1;
                    so[j]=seg[v];
                }
                else
                {
                    if(dp[j]>dp[i-1]+1)
                    {
                        dp[j]=dp[i-1]+1;
                        so[j]=seg[v];
                    }
                }
            }
        }
    }
    if(dp[t.length()-1]==(1<<30))
        puts("-1");
    else
    {
        printf("%d\n",dp[t.length()-1]);
        print(t.length()-1);
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#define M 5010

using namespace std;

char A[M], B[M];

int sta, stb, L[M], R[M], Cnt = 0;

int Match(int x)
{
    int Max = 0, l = 0, r = 0, tmp = stb - x + 1;
    for(int i = sta; i >= 1; i--)
    {
        for(int j = 0; j <= tmp && j + i <= sta + 1; j++)
            if(B[x + j] != A[i + j])
            {
                if(Max < j)
                {
                    Max = j, l = i, r = i + j - 1;
                }
                break;
            }
    }
    for(int i = sta; i >= 1; i--)
    {
        for(int j = 0; j <= tmp && j <= i; j++)
            if(B[x + j] != A[i - j])
            {
                if(Max < j)
                {
                    Max = j, l = i, r = i - j + 1;
                }
                break;
            }
    }
    L[Cnt] = l, R[Cnt] = r;
    return Max;
}

int main()
{
    scanf("%s%s", A + 1, B + 1);
    sta = strlen(A + 1), stb = strlen(B + 1);
    A[0] = 0, A[sta + 1] = 1, B[0] = 2, B[stb + 1] = 3;
    int Now = 1, getans = 1;
    for(; ;)
    {
        Cnt++;
        int tmp = Match(Now);
        if(!tmp)
        {
            getans = 0;
            break;
        }
        Now += tmp;
        if(Now > stb) break;
    }
    if(!getans) puts("-1");
    else
    {
        printf("%d\n", Cnt);
        for(int i = 1; i <= Cnt; i++) printf("%d %d\n", L[i], R[i]);
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#define M 5010

using namespace std;

char A[M], B[M];

int Fail[M], sta, stb, Cnt = 0, L[M], R[M];

bool Match(int x, int y)
{
	for(int i = 1; i <= sta; i++)
	{
		int Can = 1;
		for(int j = x; j <= y; j++)
			if(B[j] != A[i + j - x])
			{
				Can = 0;
				break;
			}
		if(Can)
		{
			L[++Cnt] = i, R[Cnt] = i + y - x;
			return 1;
		}
		int tmp = i;
		Can = 1;
		for(int j = y; j >= x; j--)
			if(B[j] != A[tmp])
			{
				Can = 0;
				break;
			}
			else tmp++;
		if(Can)
		{
			L[++Cnt] = i + y - x, R[Cnt] = i;
			return 1;
		}
	}
	return 0;
}

int main()
{
	gets(A + 1);
	gets(B + 1);
	sta = strlen(A + 1), stb = strlen(B + 1);
	int getans = 0, Now = 1;
	for(; ;)
	{
		int Can = 0;
		for(int i = stb; i >= 1; i--)
			if(Match(Now, i))
			{
				Can = 1, Now = i + 1;
				break;
			}
		if(!Can) break;
		if(Now > stb)
		{
			getans = 1;
			break;
		}
	}
	if(!getans) puts("-1");
	else
	{
		printf("%d\n", Cnt);
		for(int i = 1; i <= Cnt; i++) printf("%d %d\n", L[i], R[i]);
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#define M 5010
#define P 999999999999947ll

using namespace std;

typedef long long ll;

char A[M], B[M];

int Fail[M], sta, stb, Cnt = 0, L[M], R[M];

ll get_hsh(char *A, int x, int y)
{
    ll ans = 0;
    if(x <= y)
    for(int i = x; i <= y; i++) ans = (ans * 131 + A[i]) % P;
    else
    for(int i = x; i >= y; i--) ans = (ans * 131 + A[i]) % P;
    return ans;
}

bool Match(int x, int y)
{
    ll X = get_hsh(B, x, y), tmp = y - x + 1, O = 1, Y = get_hsh(A, 1, tmp);
    for(int i = 1; i < tmp; i++) O = O * 131 % P;
    for(int i = 1; i <= sta; i++)
    {
        if(X == Y)
        {
            L[Cnt] = i, R[Cnt] = i + y - x;
            return 1;
        }
        Y = ((Y - O * A[i] % P + P) * 131 + A[i + tmp]) % P;
    }
    X = get_hsh(B, y, x), Y = get_hsh(A, 1, tmp);
    for(int i = 1; i <= sta; i++)
    {
        if(X == Y)
        {
            R[Cnt] = i, L[Cnt] = i + y - x;
            return 1;
        }
        Y = ((Y - O * A[i] % P + P) * 131 + A[i + tmp]) % P;
    }
    return 0;
}

int main()
{
    gets(A + 1);
    gets(B + 1);
    sta = strlen(A + 1), stb = strlen(B + 1);
    int getans = 0, Now = 1;
    for(; ;)
    {
        Cnt++;
        if(!Match(Now, Now)) break;
        int ans = 0;
        for(int l = Now, r = stb; l <= r;)
            if(Match(Now, l + r >> 1)) ans = (l + r) / 2, l = (l + r) / 2 + 1; else r = (l + r) / 2 - 1;
        Now = ans + 1;
        if(Now > stb)
        {
            getans = 1;
            break;
        }
    }
    if(!getans) puts("-1");
    else
    {
        printf("%d\n", Cnt);
        for(int i = 1; i <= Cnt; i++) printf("%d %d\n", L[i], R[i]);
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
#define M 5010
#define P 999999999999947ll

using namespace std;

typedef long long ll;

char A[M], B[M];

int Fail[M], sta, stb, Cnt = 0, L[M], R[M];

ll get_hsh(char *A, int x, int y)
{
    ll ans = 0;
    if(x <= y)
    for(int i = x; i <= y; i++) ans = (ans * 131 + A[i]) % P;
    else
    for(int i = x; i >= y; i--) ans = (ans * 131 + A[i]) % P;
    return ans;
}

bool Match(int x, int y)
{
    ll X = get_hsh(B, x, y), tmp = y - x + 1, O = 1, Y = get_hsh(A, 1, tmp);
    for(int i = 1; i < tmp; i++) O = O * 131 % P;
    for(int i = 1; i <= sta - y + x; i++)
    {
        if(X == Y)
        {
            L[Cnt] = i, R[Cnt] = i + y - x;
            return 1;
        }
        Y = ((Y - O * A[i] % P + P) * 131 + A[i + tmp]) % P;
    }
    X = get_hsh(B, y, x), Y = get_hsh(A, 1, tmp);
    for(int i = 1; i <= sta - y + x; i++)
    {
        if(X == Y)
        {
            R[Cnt] = i, L[Cnt] = i + y - x;
            return 1;
        }
        Y = ((Y - O * A[i] % P + P) * 131 + A[i + tmp]) % P;
    }
    return 0;
}

int main()
{
    gets(A + 1);
    gets(B + 1);
    sta = strlen(A + 1), stb = strlen(B + 1);
    int getans = 0, Now = 1;
    for(; ;)
    {
        Cnt++;
        if(!Match(Now, Now)) break;
        int ans = 0;
        for(int l = Now, r = stb; l <= r;)
            if(Match(Now, l + r >> 1)) ans = (l + r) / 2, l = (l + r) / 2 + 1; else r = (l + r) / 2 - 1;
        Now = ans + 1;
        if(Now > stb)
        {
            getans = 1;
            break;
        }
    }
    if(!getans) puts("-1");
    else
    {
        printf("%d\n", Cnt);
        for(int i = 1; i <= Cnt; i++) printf("%d %d\n", L[i], R[i]);
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#define M 5010
#define P 999999999999947ll

using namespace std;

typedef long long ll;

char A[M], B[M];

int Fail[M], sta, stb, Cnt = 0, L[M], R[M];

ll get_hsh(char *A, int x, int y)
{
    ll ans = 0;
    if(x <= y)
    for(int i = x; i <= y; i++) ans = (ans * 131 + A[i]) % P;
    else
    for(int i = x; i >= y; i--) ans = (ans * 131 + A[i]) % P;
    return ans;
}

bool Match(int x, int y)
{
    ll X = get_hsh(B, x, y), tmp = y - x + 1, O = 1, Y = get_hsh(A, 1, tmp);
    for(int i = 1; i < tmp; i++) O = O * 131 % P;
    for(int i = 1; i <= sta; i++)
    {
        if(X == Y)
        {
            L[++Cnt] = i, R[Cnt] = i + y - x;
            return 1;
        }
        Y = ((Y - O * A[i] % P + P) * 131 + A[i + tmp]) % P;
    }
    X = get_hsh(B, y, x), Y = get_hsh(A, 1, tmp);
    for(int i = 1; i <= sta; i++)
    {
        if(X == Y)
        {
            R[++Cnt] = i, L[Cnt] = i + y - x;
            return 1;
        }
        Y = ((Y - O * A[i] % P + P) * 131 + A[i + tmp]) % P;
    }
    return 0;
}

int main()
{
    gets(A + 1);
    gets(B + 1);
    sta = strlen(A + 1), stb = strlen(B + 1);
    int getans = 0, Now = 1;
    for(; ;)
    {
        int Can = 0;
        for(int i = stb; i >= 1; i--)
            if(Match(Now, i))
            {
                Can = 1, Now = i + 1;
                break;
            }
        if(!Can) break;
        if(Now > stb)
        {
            getans = 1;
            break;
        }
    }
    if(!getans) puts("-1");
    else
    {
        printf("%d\n", Cnt);
        for(int i = 1; i <= Cnt; i++) printf("%d %d\n", L[i], R[i]);
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#define M 5010

using namespace std;

char A[M], B[M];

int sta, stb, L[M], R[M], Cnt = 0;

int Match(int x)
{
    int Max = 0, l = 0, r = 0, tmp = stb - x + 1;
    for(int i = 1; i <= sta; i++)
    {
        for(int j = 0; j <= tmp && j + i <= sta + 1; j++)
            if(B[x + j] != A[i + j])
            {
                if(Max < j)
                {
                    Max = j, l = i, r = i + j - 1;
                }
                break;
            }
    }
    for(int i = 1; i <= sta; i++)
    {
        for(int j = 0; j <= tmp && j <= i; j++)
            if(B[x + j] != A[i - j])
            {
                if(Max < j)
                {
                    Max = j, l = i, r = i - j + 1;
                }
                break;
            }
    }
    L[Cnt] = l, R[Cnt] = r;
    return Max;
}

int main()
{
    scanf("%s%s", A + 1, B + 1);
    sta = strlen(A + 1), stb = strlen(B + 1);
    A[0] = 0, A[sta + 1] = 1, B[0] = 2, B[stb + 1] = 3;
    int Now = 1, getans = 1;
    for(; ;)
    {
        Cnt++;
        int tmp = Match(Now);
        if(!tmp)
        {
            getans = 0;
            break;
        }
        Now += tmp;
        if(Now > stb) break;
    }
    if(!getans) puts("-1");
    else
    {
        printf("%d\n", Cnt);
        for(int i = 1; i <= Cnt; i++) printf("%d %d\n", L[i], R[i]);
    }
    return 0;
}


#include<iostream>
#include<string>
#include<math.h>
#include<stdio.h>
using namespace std;
int x[2000];
int y[2000];
int p;

int main()
{
    string a,b;
    cin>>a>>b;
    int la=a.length();
    int lt=la;
    int lb=b.length();
    for(int i=la-2;i>=0;i--)
    {
        a+=a[i];
    }
    la=a.length();
    //cout<<lt<<" "<<a<<endl;
    int bs=0;
    int num=0;
    int k=0;
    int view;
    while(1)
    {
        //cout<<"bs=="<<bs<<endl;
       // cout<<"****************"<<endl;
        view=0;
        for(int i=0;i<la;i++)
        {
            //cout<<"i=="<<i<<endl<<endl;
            for(int j=bs;j<lb;j++)
            {
                if(i<lt&&i+j-bs==lt)
                {
                    p=num;
                    num=max(num,lt-i);
                    if(num>p)
                    {x[k]=i;
                    y[k]=lt-1;}
                    break;
                }
                //cout<<"i="<<i+j-bs<<" j="<<j<<endl;
                if(i+j-bs>=la)
                {
                   // cout<<"111"<<endl;
                    p=num;
                    num=max(num,j-bs);
                   // cout<<num<<endl;
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs-1;
                    //cout<<x[k]<<"111"<<y[k]<<endl;
                        break;
                    }
                }
                if(a[i+j-bs]!=b[j])
                {
                    //cout<<222<<endl;
                   // cout<<j<<" "<<i+j-bs<<endl;
                    //cout<<a[i+j-bs]<<"  "<<b[j]<<endl;
                    p=num;
                    num=max(num,j-bs);
                    //cout<<num<<" =num"<<endl;
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs-1;
                        //cout<<x[k]<<" 222 "<<y[k]<<endl;
                    }
                    break;
                }
                if(j==lb-1)
                {

                  // cout<<333<<endl;
                    p=num;
                    num=max(num,j-bs+1);
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs;
                       // cout<<x[k]<<" 333 "<<y[k]<<endl;
                    }
                }
                view=1;
            }
        }
        if(view==0)
        {
            cout<<-1;
            return 0;
        }
        bs+=num;
        num=0;
        //cout<<"ooooooooo   "<<x[k]<<"  55  "<<y[k]<<endl;
        if(bs>=lb)break;k++;
        //getchar();
    }
    cout<<k+1<<endl;
    for(int i=0;i<k+1;i++)
    {
        if(x[i]<lt)cout<<x[i]+1;
        else{
            cout<<2*lt-x[i]-1;
        }
        cout<<" ";
        if(y[i]<lt)cout<<y[i]+1;
        else{
            cout<<2*lt-y[i]-1;
        }
        cout<<endl;
    }
    return 0;
}
/*
aaabrytaaa
ayrat
*/


#include<iostream>
#include<string>
#include<math.h>
#include<stdio.h>
using namespace std;
int x[2000];
int y[2000];
int p;

int main()
{
    string a,b;
    cin>>a>>b;
    int la=a.length();
    int lt=la;
    int lb=b.length();
    for(int i=la-2;i>=0;i--)
    {
        a+=a[i];
    }
    la=a.length();
    //cout<<lt<<" "<<a<<endl;
    int bs=0;
    int num=0;
    int k=0;
    int view;
    while(1)
    {
        //cout<<"bs=="<<bs<<endl;
       // cout<<"****************"<<endl;
        view=0;
        for(int i=0;i<la;i++)
        {
            //cout<<"i=="<<i<<endl<<endl;
            for(int j=bs;j<lb;j++)
            {
                if(i<lt-1&&i+j-bs==lt)
                {
                    p=num;
                    num=max(num,lt-i);
                    if(num>p)
                    {x[k]=i;
                    y[k]=lt-1;}
                    break;
                }
                //cout<<"i="<<i+j-bs<<" j="<<j<<endl;
                if(i+j-bs>=la)
                {
                   // cout<<"111"<<endl;
                    p=num;
                    num=max(num,j-bs);
                   // cout<<num<<endl;
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs-1;
                    //cout<<x[k]<<"111"<<y[k]<<endl;
                        break;
                    }
                }
                if(a[i+j-bs]!=b[j])
                {
                    //cout<<222<<endl;
                   // cout<<j<<" "<<i+j-bs<<endl;
                    //cout<<a[i+j-bs]<<"  "<<b[j]<<endl;
                    p=num;
                    num=max(num,j-bs);
                    //cout<<num<<" =num"<<endl;
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs-1;
                        //cout<<x[k]<<" 222 "<<y[k]<<endl;
                    }
                    break;
                }
                if(j==lb-1)
                {

                  // cout<<333<<endl;
                    p=num;
                    num=max(num,j-bs+1);
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs;
                       // cout<<x[k]<<" 333 "<<y[k]<<endl;
                    }
                }
                view=1;
            }
        }
        if(view==0)
        {
            cout<<-1;
            return 0;
        }
        bs+=num;
        num=0;
        //cout<<"ooooooooo   "<<x[k]<<"  55  "<<y[k]<<endl;
        if(bs>=lb)break;k++;
        //getchar();
    }
    cout<<k+1<<endl;
    for(int i=0;i<k+1;i++)
    {
        if(x[i]<lt)cout<<x[i]+1;
        else{
            cout<<2*lt-x[i]-1;
        }
        cout<<" ";
        if(y[i]<lt)cout<<y[i]+1;
        else{
            cout<<2*lt-y[i]-1;
        }
        cout<<endl;
    }
    return 0;
}
/*
aaabrytaaa
ayrat
*/


#include<iostream>
#include<cstdio>
#include<cstring>
#define Ri(a) scanf("%d", &a)
#define Rl(a) scanf("%I64d", &a)
#define Rf(a) scanf("%lf", &a)
#define Rs(a) scanf("%s", a)
#define Pi(a) printf("%d\n", (a))
#define Pf(a) printf("%.2lf\n", (a))
#define Pl(a) printf("%I64d\n", (a))
#define Ps(a) printf("%s\n", (a))
#define Pk() printf(" ");
#define CLR(a, b) memset(a, (b), sizeof(a))
using namespace std;

char s[2200],t[2200],rs[2200];
int ans[2200][2];

int main()
{
    Rs(s);
    Rs(t);
    strcpy(rs,s);
    strrev(rs);
    int ls=strlen(s),lt=strlen(t);
    int i=0;
    int rnext=-1;
    int num=0;
    int l,r;
    while(i<lt)
    {
        for(int j=0;j<ls;j++)
        {
            int k=j; int next=i;
            while(k<ls&&s[k]==t[next]) {k++; next++;}
           // cout<<"a k= "<<k<<" next= "<<next<<endl;
            if(next>rnext) {rnext=next; l=j+1; r=k;
            //cout<<"a l= "<<l<<" r= "<<r<<endl;
            }

        }
        for(int j=0;j<ls;j++)
        {
            int k=j; int next=i;
            while(k<ls&&rs[k]==t[next]) {k++; next++;}
            //cout<<"b k= "<<k<<" next= "<<next<<endl;
            if(next>rnext) {rnext=next; l=ls-j; r=ls-k+1;
            //cout<<"b l= "<<l<<" r= "<<r<<endl;
            }

        }
       // cout<<"r "<<rnext<<" i= "<<i<<endl;
        if(i==rnext)
        {
            printf("-1\n");
            return 0;
        }
        else
        {
            ans[num][0]=l; ans[num][1]=r;
            num++;
            i=rnext;
        }
    }
    Pi(num);
    for(int i=0;i<num;i++)
    {
        printf("%d %d\n",ans[i][0],ans[i][1]);
    }
    return 0;
};


#include<iostream>
#include<string>
#include<math.h>
#include<stdio.h>
using namespace std;
int x[2000];
int y[2000];
int p;

int main()
{
    string a,b;
    cin>>a>>b;
    int la=a.length();
    int lt=la;
    int lb=b.length();
    for(int i=la-2;i>=0;i--)
    {
        a+=a[i];
    }
    la=a.length();
    //cout<<lt<<" "<<a<<endl;
    int bs=0;
    int num=0;
    int k=0;
    int view;
    while(1)
    {
        //cout<<"bs=="<<bs<<endl;
       // cout<<"****************"<<endl;
        view=0;
        for(int i=0;i<la;i++)
        {
            //cout<<"i=="<<i<<endl<<endl;
            for(int j=bs;j<lb;j++)
            {
                //cout<<"i="<<i+j-bs<<" j="<<j<<endl;
                if(i+j-bs>=la)
                {
                   // cout<<"111"<<endl;
                    p=num;
                    num=max(num,j-bs);
                   // cout<<num<<endl;
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs-1;
                    //cout<<x[k]<<"111"<<y[k]<<endl;
                        break;
                    }
                }
                if(a[i+j-bs]!=b[j])
                {
                    //cout<<222<<endl;
                   // cout<<j<<" "<<i+j-bs<<endl;
                    //cout<<a[i+j-bs]<<"  "<<b[j]<<endl;
                    p=num;
                    num=max(num,j-bs);
                    //cout<<num<<" =num"<<endl;
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs-1;
                        //cout<<x[k]<<" 222 "<<y[k]<<endl;
                    }
                    break;
                }
                if(j==lb-1)
                {
                   // cout<<333<<endl;
                    p=num;
                    num=max(num,j-bs+1);
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs;
                    //cout<<x[k]<<"333"<<y[k]<<endl;
                    }

                }
                view=1;
            }
        }
        if(view==0)
        {
            cout<<-1;
            return 0;
        }
        bs+=num;
        num=0;
        //cout<<"ooooooooo   "<<x[k]<<"  55  "<<y[k]<<endl;
        if(bs>=lb)break;k++;
        //getchar();
    }
    cout<<k<<endl;
    for(int i=0;i<k+1;i++)
    {
        if(x[i]<lt)cout<<x[i]+1;
        else{
            cout<<2*lt-x[i]-1;
        }
        cout<<" ";
        if(y[i]<lt)cout<<y[i]+1;
        else{
            cout<<2*lt-y[i]-1;
        }
        cout<<endl;
    }
    return 0;
}
/*
aaabrytaaa
ayrat
*/


#include<iostream>
#include<string>
#include<math.h>
#include<stdio.h>
using namespace std;
int x[2000];
int y[2000];
int p;

int main()
{
    string a,b;
    cin>>a>>b;
    int la=a.length();
    int lt=la;
    int lb=b.length();
    for(int i=la-2;i>=0;i--)
    {
        a+=a[i];
    }
    la=a.length();
    //cout<<lt<<" "<<a<<endl;
    int bs=0;
    int num=0;
    int k=0;
    int view;
    while(1)
    {
        //cout<<"bs=="<<bs<<endl;
       // cout<<"****************"<<endl;
        view=0;
        for(int i=0;i<la;i++)
        {
            //cout<<"i=="<<i<<endl<<endl;
            for(int j=bs;j<lb;j++)
            {
                //cout<<"i="<<i+j-bs<<" j="<<j<<endl;
                if(i+j-bs>=la)
                {
                   // cout<<"111"<<endl;
                    p=num;
                    num=max(num,j-bs);
                   // cout<<num<<endl;
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs-1;
                    //cout<<x[k]<<"111"<<y[k]<<endl;
                        break;
                    }
                }
                if(a[i+j-bs]!=b[j])
                {
                    //cout<<222<<endl;
                   // cout<<j<<" "<<i+j-bs<<endl;
                    //cout<<a[i+j-bs]<<"  "<<b[j]<<endl;
                    p=num;
                    num=max(num,j-bs);
                    //cout<<num<<" =num"<<endl;
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs-1;
                        //cout<<x[k]<<" 222 "<<y[k]<<endl;
                    }
                    break;
                }
                if(j==lb-1)
                {
                   // cout<<333<<endl;
                    p=num;
                    num=max(num,j-bs+1);
                    if(num>p)
                    {
                        x[k]=i;
                        y[k]=i+j-bs;
                    //cout<<x[k]<<"333"<<y[k]<<endl;
                    }

                }
                view=1;
            }
        }
        if(view==0)
        {
            cout<<-1;
            return 0;
        }
        bs+=num;
        num=0;
        //cout<<"ooooooooo   "<<x[k]<<"  55  "<<y[k]<<endl;
        if(bs>=lb)break;k++;
        //getchar();
    }
    cout<<k+1<<endl;
    for(int i=0;i<k+1;i++)
    {
        if(x[i]<lt)cout<<x[i]+1;
        else{
            cout<<2*lt-x[i]-1;
        }
        cout<<" ";
        if(y[i]<lt)cout<<y[i]+1;
        else{
            cout<<2*lt-y[i]-1;
        }
        cout<<endl;
    }
    return 0;
}
/*
aaabrytaaa
ayrat
*/


#include<bits/stdc++.h>
using namespace std;
int main(){
    string p1,p2;
    cin>>p1>>p2;
    long long x=0;
    vector<pair<long long,long long> >vec;
    long long i=0;
    while(i<p2.length()){
        long long l=0,m=0,k=0,o=0;
        long long yo=0,yu=0;
        long long comp=0;
        for(long long j=0;j<p1.length();j++){
            if(p2[i]==p1[j]){comp++;}
            long long h=i;
            long long u=j;
            long long x=0;
            long long y=0;
            while(p2[h]==p1[u] and h<p2.length() and u<p1.length()){
                h++;u++;x++;
            }
            h=i;
            u=j;
            while(p2[h]==p1[u] and h<p2.length() and u>=0){
                h++;u--;y++;
            }
           if(x>yo){
            yo=x;l=j;m=j+yo-1;
           }
           if(y>yu){
            yu=y;k=j;o=j-yu+1;
           }
            }
        if(comp==0){cout<<-1<<endl;return 0;}
        if(yo>yu){
            pair<long long,long long>par;
        par.first=l;
        par.second=m;
        vec.push_back(par);
        i=i+m-l+1;
        }
        else{
            pair<long long,long long>par;
        par.first=k;
        par.second=o;
        vec.push_back(par);
        i=i+k-o+1;
        }
        }
        cout<<vec.size()<<endl;
    for(long long i=0;i<vec.size();i++){
        cout<<vec[i].first+1<<" "<<vec[i].second+1<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    string p1,p2;
    cin>>p1>>p2;
    int x=0;
    vector<pair<int,int> >vec;
    for(int i=0;i<p2.length();i++){
        int l=0,m=0,k=0,o=0;
        int yo=0,yu=0;
        int comp=0;
        for(int j=0;j<p1.length();j++){
            if(p2[i]==p1[j]){comp++;}
            int h=i;
            int u=j;
            int x=0;
            int y=0;
            while(p2[h]==p1[u] and h<p2.length() and u<p1.length()){
                h++;u++;x++;
            }
            h=i;
            u=j;
            while(p2[h]==p1[u] and h<p2.length() and u>=0){
                h++;u--;y++;
            }
           if(x>yo){
            yo=x;l=j;m=j+yo-1;
           }
           if(y>yu){
            yu=y;k=j;o=j-yu+1;
           }
            }
        if(comp==0){cout<<-1<<endl;return 0;}
        if(yo>yu){
            pair<int,int>par;
        par.first=l;
        par.second=m;
        vec.push_back(par);
        i=i+yo-1;
        }
        else{
            pair<int,int>par;
        par.first=k;
        par.second=o;
        vec.push_back(par);
        }
        i=i+yu-1;
        }
        cout<<vec.size()<<endl;
    for(int i=0;i<vec.size();i++){
        cout<<vec[i].first+1<<" "<<vec[i].second+1<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    string p1,p2;
    cin>>p1>>p2;
    int x=0;
    vector<pair<int,int> >vec;
    for(int i=0;i<p2.length();i++){
        int l,m,k,o;
        int yo=0,yu=0;
        for(int j=0;j<p1.length();j++){
            int h=i;
            int ma=i;
            int u=j;
            int x=0;
            int y=0;
            while(p2[h]==p1[u] and h<p2.length() and u<p1.length()){
                h++;u++;x++;
            }
            h=i;
            u=j;
            while(p2[h]==p1[u] and h<p2.length() and u>=0){
                h++;u--;y++;
            }
           if(x>yo){
            yo=x;l=j;m=j+yo-1;
           }
           if(y>yu){
            yu=y;k=j;o=j-yu+1;
           }
            }
        if(yo>yu){
            pair<int,int>par;
        par.first=l;
        par.second=m;
        vec.push_back(par);
        i=i+yo-1;
        }
        else{
            pair<int,int>par;
        par.first=k;
        par.second=o;
        vec.push_back(par);
        }
        i=i+yu-1;
        }
        cout<<vec.size()<<endl;
    for(int i=0;i<vec.size();i++){
        cout<<vec[i].first+1<<" "<<vec[i].second+1<<endl;
    }
}


 /*
 Problem name :
 Algorithm : Not Sure Yet
 Contest/Practice :
 Source :
 Comment : Whenever you start to believe  yourself, people also start to believe in you
 Date : --
 Last Update : 25-Mar-2015
*/

/*
    SO STEP INSIDE/ SEE THE DEVIL IN I
    Too many times, we’ve let it come to this
    STEP INSIDE/ SEE THE DEVIL IN I
    Oh, when all that’s left does not make sense
    STEP INSIDE/ SEE THE DEVIL IN I
    I know you’ll find your answers in the end
    STEP INSIDE/ SEE THE DEVIL IN I
    You’ll realize I’m not your Devil… anymore

*/

#include<bits/stdc++.h>

#define pause           system("pause");
#define FOR(s,e,inc)    for(int i=s;i<=e;i+=inc)
#define mod             1000000007
#define inf             1<<30
#define pb              push_back
#define ppb             pop_back
#define mp              make_pair
#define F               first
#define S               second
#define sz(x)           ((int)x.size())
#define sqr(x)          ( (x)* (x) )
#define eps             1e-9
#define lcm(x,y)        (abs(x) /gcd(x,y))* abs(y)
#define on(x,w)         x|(1<<w)
#define check(x,w)      (x&(1<<w))
#define all(x)          (x).begin(),(x).end()
#define pf              printf
#define sf              scanf
#define pi              acos(-1.0)
#define reset(x,v)      memset(x,v,sizeof(x));
#define AND             &&
#define OR              ||
#define what_is(x)      cerr<<#x<<" is "<<x<<"\n";

typedef long long ll;
typedef unsigned long long llu;

using namespace std;

template<class T>
inline T mod_v(T num)
{
    if(num>=0)
        return num%mod;
    else
        return (num%mod+mod)%mod;
}
template<class T>
inline T gcd(T a,T b)
{
    a=abs(a);
    b=abs(b);

    while(b) b ^= a ^= b ^= a %= b;
    return a;
}

template<class T>
T fast_pow(T n , T p)
{
    if(p==0) return 1;
    if(p%2)
    {
        T g=mod_v ( mod_v(n) * mod_v(fast_pow(n,p-1)) );
        return g;
    }
    else
    {
        T g=fast_pow(n,p/2);
        g=mod_v( mod_v(g) * mod_v(g) ) ;
        return g;
    }
}

template<class T>
inline T modInverse(T n)
{
    return fast_pow(n,mod-2);
}

template<class T>
inline void debug(string S1,T S2,string S3)
{
    cout<<S1<<S2<<S3;
}

bool equalTo ( double a, double b ){ if ( fabs ( a - b ) <= eps ) return true; else return false; }
bool notEqual ( double a, double b ){if ( fabs ( a - b ) > eps ) return true; else return false; }
bool lessThan ( double a, double b ){ if ( a + eps < b ) return true; else return false; }
bool lessThanEqual ( double a, double b ){if ( a < b + eps ) return true;   else return false;}
bool greaterThan ( double a, double b ){if ( a > b + eps ) return true;else return false;}
bool greaterThanEqual ( double a, double b ){if ( a + eps > b ) return true;else return false;}

template<class T>
inline int in(register T& num)
{
    register char c=0;
    num=0;
    bool n=false;
    while(c<33)c=getchar();
    while(c>33){
        if(c=='-')
            n=true;
        else num=num*10+c-'0';
        c=getchar();
    }
    num=n?-num:num;
    return 1;
}

/******* ! Code start from here ! *******/

 string s,t,m,z;
 int tmp;

bool test(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(mod_v(h1*31)+m[j] );
        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(mod_v(h2*31)+s[j] );
    }

    for(int j=mid-1;j<sz(s) && !ok;j++)
    {
        h2=mod_v(mod_v(h2*31)+s[j] );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-mod_v(p*s[j-mid+1] ) );
    }

    return ok;
}

bool test1(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(mod_v(h1*31)+m[j] );

        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(mod_v(h2*31)+z[j] );
    }

    for(int j=mid-1;j<sz(z) && !ok;j++)
    {
        h2=mod_v(mod_v(h2*31)+z[j] );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-mod_v(p*z[j-mid+1] ) );
    }

    return ok;
}

int main()
{
//     std::ios_base::sync_with_stdio(false);

    #ifdef kimbbakar
        freopen ( "in.txt", "r", stdin );
//        freopen ( "out.txt", "w", stdout );
    #endif

    cin>>s>>t;

    z=s;

    reverse(all(z) );

    int i=0;

    vector<pair<int,int> >kp;

    while(i<sz(t))
    {
        m=t.substr(i,sz(t)-i);

        int l=0,r=sz(s);

        int res=0,fes=0;
        int p1,p2;

        while(l<=r)
        {
            int mid=(l+r)>>1;
            if(mid>sz(s) )
                r=mid;

            bool ok=test(mid);

            if(ok)
            {

                if(res<mid)
                {
                    p1=tmp;
                    res=mid;
                }
            }

            if(l==mid)
            {
                ok=test(r);

                if(ok)
                {
                    if(res<r)
                    {
                        p1=tmp;
                        res=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        l=0,r=sz(s);

        while(l<=r)
        {
            int mid=(l+r)>>1;

            if(mid>sz(z) )
                r=mid;

            bool ok=test1(mid);

            if(ok)
            {
                if(fes<mid)
                {
                    p2=tmp;
                    fes=mid;
                }
            }

            if(l==mid)
            {
                ok=test1(r);

                if(ok)
                {
                    if(fes<r)
                    {
                        p2=tmp;
                        fes=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        if(res>=fes)
        {
            kp.pb(mp(p1+1,p1+res) );
            i+=res;
        }
        else
        {
            kp.pb(mp(sz(z)-p2,sz(z)-p2-fes+1 ) );
            i+=fes;
        }

    }

    pf("%d\n",sz(kp));

    for(int i=0;i<sz(kp);i++)
    {
        pf("%d %d\n",kp[i].F,kp[i].S);
    }

    return 0;
}


 /*
 Problem name :
 Algorithm : Not Sure Yet
 Contest/Practice :
 Source :
 Comment : Whenever you start to believe  yourself, people also start to believe in you
 Date : --
 Last Update : 25-Mar-2015
*/

/*
    Am I wrong for thinking out the box from where I stay?
    Am I wrong for saying that I choose another way?

    I ain't tryna do what everybody else doing
    Just cause everybody doing what they all do
    If one thing I know, I'll fall but I'll grow
    I'm walking down this road of mine, this road that I call home

*/

#include<bits/stdc++.h>

#define pause           system("pause");
#define FOR(s,e,inc)    for(int i=s;i<=e;i+=inc)
#define mod             1000000007
#define inf             1<<30
#define pb              push_back
#define ppb             pop_back
#define mp              make_pair
#define F               first
#define S               second
#define sz(x)           ((int)x.size())
#define sqr(x)          ( (x)* (x) )
#define eps             1e-9
#define lcm(x,y)        (abs(x) /gcd(x,y))* abs(y)
#define on(x,w)         x|(1<<w)
#define check(x,w)      (x&(1<<w))
#define all(x)          (x).begin(),(x).end()
#define pf              printf
#define sf              scanf
#define pi              acos(-1.0)
#define reset(x,v)      memset(x,v,sizeof(x));
#define AND             &&
#define OR              ||
#define what_is(x)      cerr<<#x<<" is "<<x<<"\n";

typedef long long ll;
typedef unsigned long long llu;

using namespace std;

template<class T>
inline T mod_v(T num)
{
    if(num>=0)
        return num%mod;
    else
        return (num%mod+mod)%mod;
}
template<class T>
inline T gcd(T a,T b)
{
    a=abs(a);
    b=abs(b);

    while(b) b ^= a ^= b ^= a %= b;
    return a;
}

template<class T>
T fast_pow(T n , T p)
{
    if(p==0) return 1;
    if(p%2)
    {
        T g=mod_v ( mod_v(n) * mod_v(fast_pow(n,p-1)) );
        return g;
    }
    else
    {
        T g=fast_pow(n,p/2);
        g=mod_v( mod_v(g) * mod_v(g) ) ;
        return g;
    }
}

template<class T>
inline T modInverse(T n)
{
    return fast_pow(n,mod-2);
}

template<class T>
inline void debug(string S1,T S2,string S3)
{
    cout<<S1<<S2<<S3;
}

bool equalTo ( double a, double b ){ if ( fabs ( a - b ) <= eps ) return true; else return false; }
bool notEqual ( double a, double b ){if ( fabs ( a - b ) > eps ) return true; else return false; }
bool lessThan ( double a, double b ){ if ( a + eps < b ) return true; else return false; }
bool lessThanEqual ( double a, double b ){if ( a < b + eps ) return true;   else return false;}
bool greaterThan ( double a, double b ){if ( a > b + eps ) return true;else return false;}
bool greaterThanEqual ( double a, double b ){if ( a + eps > b ) return true;else return false;}

template<class T>
inline int in(register T& num)
{
    register char c=0;
    num=0;
    bool n=false;
    while(c<33)c=getchar();
    while(c>33){
        if(c=='-')
            n=true;
        else num=num*10+c-'0';
        c=getchar();
    }
    num=n?-num:num;
    return 1;
}

/******* ! Code start from here ! *******/

class nod
{
public:
    int idx,F,S;

    bool operator < (const nod& a) const
    {
        return (F==a.F)?(S<a.S):(F<a.F);
    }
};

int pos[20][2109];
int suf[2109];
int puf[2109];
nod tupl[2109];

vector<string>x,y;

string s,t;

void build()
{
    for(int i=0;i<sz(s);i++)
    {
        pos[0][i]=s[i]-'a';
    }

    for(int i=1,p=1;p<sz(s);i++,p*=2)
    {
        for(int j=0;j<sz(s);j++)
        {
            tupl[j].idx=j;

            tupl[j].F=pos[i-1][j];
            tupl[j].S=(j+p)<sz(s)?pos[i-1][(j+p)]:-1;
        }

        sort(tupl,tupl+sz(s) );

        for(int j=0;j<sz(s);j++)
        {
            pos[i][tupl[j].idx]=(j>0 && tupl[j-1].F==tupl[j].F && tupl[j-1].S==tupl[j].S )?pos[i][tupl[j-1].idx ]:j;
            suf[j]=tupl[j].idx;// what_is(suf[j])
        }
    }
}

int main()
{
//     std::ios_base::sync_with_stdio(false);

    #ifdef kimbbakar
        freopen ( "in.txt", "r", stdin );
//        freopen ( "out.txt", "w", stdout );
    #endif

    cin>>s>>t;
    s.pb('z'+1);

    build();

    for(int i=0;i<sz(s);i++)
    {
//        what_is(suf[i] )
        x.pb(s.substr(suf[i],sz(s)-suf[i] ) );
        puf[i]=suf[i];

    }

    s[sz(s)-1]='\0';

    reverse(all(s) );
    s.pb('z'+1);

    build();

    for(int i=0;i<sz(s);i++)
    {
        y.pb(s.substr(suf[i],sz(s)-suf[i] ) );
    }

    int l=0;

    vector<pair<int,int> >res;

    while(l<sz(t))
    {
        string m=t.substr(l,sz(t)-l);

        int a=lower_bound(all(x) ,m)-x.begin();
        int b=lower_bound(all(y) ,m)-y.begin();
//        a--;
 //       b--;

        int i=0,j=0;

        for(;i<sz(x[a] ) && i<sz(m);i++ )
        {
            if(x[a][i]!=m[i] )
                break;
        }

        for(;j<sz(y[b] ) && j<sz(m);j++ )
        {
            if(y[b][j]!=m[j] )
                break;
        }
//        pf("%d(%d) %d(%d) \n",a,i,b,j); pause

        if(i==0 && j==0)
        {
            pf("-1");
            return 0;
        }

        if(i>=j)
        {
            res.pb(mp(puf[a]+1,puf[a]+i ) );
            l+=i;
        }
        else
        {
            res.pb(mp(sz(s)-suf[b]-1,sz(s)-suf[b]-j ) );
            l+=j;
        }

    }

    pf("%d\n",sz(res));

    for(int i=0;i<sz(res);i++)
    {
        pf("%d %d\n",res[i].F,res[i].S);
    }

    return 0;
}


 /*
 Problem name :
 Algorithm : Not Sure Yet
 Contest/Practice :
 Source :
 Comment : Whenever you start to believe  yourself, people also start to believe in you
 Date : --
 Last Update : 25-Mar-2015
*/

/*
    SO STEP INSIDE/ SEE THE DEVIL IN I
    Too many times, we’ve let it come to this
    STEP INSIDE/ SEE THE DEVIL IN I
    Oh, when all that’s left does not make sense
    STEP INSIDE/ SEE THE DEVIL IN I
    I know you’ll find your answers in the end
    STEP INSIDE/ SEE THE DEVIL IN I
    You’ll realize I’m not your Devil… anymore

*/

#include<bits/stdc++.h>

#define pause           system("pause");
#define FOR(s,e,inc)    for(int i=s;i<=e;i+=inc)
#define mod             1000000007
#define inf             1<<30
#define pb              push_back
#define ppb             pop_back
#define mp              make_pair
#define F               first
#define S               second
#define sz(x)           ((int)x.size())
#define sqr(x)          ( (x)* (x) )
#define eps             1e-9
#define lcm(x,y)        (abs(x) /gcd(x,y))* abs(y)
#define on(x,w)         x|(1<<w)
#define check(x,w)      (x&(1<<w))
#define all(x)          (x).begin(),(x).end()
#define pf              printf
#define sf              scanf
#define pi              acos(-1.0)
#define reset(x,v)      memset(x,v,sizeof(x));
#define AND             &&
#define OR              ||
#define what_is(x)      cerr<<#x<<" is "<<x<<"\n";

typedef long long ll;
typedef unsigned long long llu;

using namespace std;

template<class T>
inline T mod_v(T num)
{
    if(num>=0)
        return num%mod;
    else
        return (num%mod+mod)%mod;
}
template<class T>
inline T gcd(T a,T b)
{
    a=abs(a);
    b=abs(b);

    while(b) b ^= a ^= b ^= a %= b;
    return a;
}

template<class T>
T fast_pow(T n , T p)
{
    if(p==0) return 1;
    if(p%2)
    {
        T g=mod_v ( mod_v(n) * mod_v(fast_pow(n,p-1)) );
        return g;
    }
    else
    {
        T g=fast_pow(n,p/2);
        g=mod_v( mod_v(g) * mod_v(g) ) ;
        return g;
    }
}

template<class T>
inline T modInverse(T n)
{
    return fast_pow(n,mod-2);
}

template<class T>
inline void debug(string S1,T S2,string S3)
{
    cout<<S1<<S2<<S3;
}

bool equalTo ( double a, double b ){ if ( fabs ( a - b ) <= eps ) return true; else return false; }
bool notEqual ( double a, double b ){if ( fabs ( a - b ) > eps ) return true; else return false; }
bool lessThan ( double a, double b ){ if ( a + eps < b ) return true; else return false; }
bool lessThanEqual ( double a, double b ){if ( a < b + eps ) return true;   else return false;}
bool greaterThan ( double a, double b ){if ( a > b + eps ) return true;else return false;}
bool greaterThanEqual ( double a, double b ){if ( a + eps > b ) return true;else return false;}

template<class T>
inline int in(register T& num)
{
    register char c=0;
    num=0;
    bool n=false;
    while(c<33)c=getchar();
    while(c>33){
        if(c=='-')
            n=true;
        else num=num*10+c-'0';
        c=getchar();
    }
    num=n?-num:num;
    return 1;
}

/******* ! Code start from here ! *******/

 string s,t,m,z;
 int tmp;

bool test(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(mod_v(h1*31)+m[j] );
        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(mod_v(h2*31)+s[j] );
    }

    for(int j=mid-1;j<sz(s) && !ok;j++)
    {
        h2=mod_v(mod_v(h2*31)+s[j] );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-mod_v(p*s[j-mid+1] ) );
    }

    return ok;
}

bool test1(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(mod_v(h1*31)+m[j] );

        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(mod_v(h2*31)+z[j] );
    }

    for(int j=mid-1;j<sz(z) && !ok;j++)
    {
        h2=mod_v(mod_v(h2*31)+z[j] );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-mod_v(p*z[j-mid+1] ) );
    }

    return ok;
}

int main()
{
     std::ios_base::sync_with_stdio(false);

    #ifdef kimbbakar
        freopen ( "in.txt", "r", stdin );
//        freopen ( "out.txt", "w", stdout );
    #endif

    cin>>s>>t;

    z=s;

    reverse(all(z) );

    int i=0;

    vector<pair<int,int> >kp;

    while(i<sz(t))
    {
        m=t.substr(i,sz(t)-i);

        int l=0,r=sz(s);

        int res=0,fes=0;
        int p1,p2;

        while(l<=r)
        {
            int mid=(l+r)>>1;
            if(mid>sz(s) )
                r=mid;

            bool ok=test(mid);

            if(ok)
            {

                if(res<mid)
                {
                    p1=tmp;
                    res=mid;
                }
            }

            if(l==mid)
            {
                ok=test(r);

                if(ok)
                {
                    if(res<r)
                    {
                        p1=tmp;
                        res=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        l=0,r=sz(s);

        while(l<=r)
        {
            int mid=(l+r)>>1;

            if(mid>sz(z) )
                r=mid;

            bool ok=test1(mid);

            if(ok)
            {
                if(fes<mid)
                {
                    p2=tmp;
                    fes=mid;
                }
            }

            if(l==mid)
            {
                ok=test1(r);

                if(ok)
                {
                    if(fes<r)
                    {
                        p2=tmp;
                        fes=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        if(res==fes && res==0)
        {
            pf("-1\n");
            return 0;
        }

        if(res>=fes)
        {
            kp.pb(mp(p1+1,p1+res) );
            i+=res;
        }
        else
        {
            kp.pb(mp(sz(z)-p2,sz(z)-p2-fes+1 ) );
            i+=fes;
        }

    }

    pf("%d\n",sz(kp));

    for(int i=0;i<sz(kp);i++)
    {
        pf("%d %d\n",kp[i].F,kp[i].S);
    }

    return 0;
}


 /*
 Problem name :
 Algorithm : Not Sure Yet
 Contest/Practice :
 Source :
 Comment : Whenever you start to believe  yourself, people also start to believe in you
 Date : --
 Last Update : 25-Mar-2015
*/

/*
    SO STEP INSIDE/ SEE THE DEVIL IN I
    Too many times, we’ve let it come to this
    STEP INSIDE/ SEE THE DEVIL IN I
    Oh, when all that’s left does not make sense
    STEP INSIDE/ SEE THE DEVIL IN I
    I know you’ll find your answers in the end
    STEP INSIDE/ SEE THE DEVIL IN I
    You’ll realize I’m not your Devil… anymore

*/

#include<bits/stdc++.h>

#define pause           system("pause");
#define FOR(s,e,inc)    for(int i=s;i<=e;i+=inc)
#define mod             1000000007
#define inf             1<<30
#define pb              push_back
#define ppb             pop_back
#define mp              make_pair
#define F               first
#define S               second
#define sz(x)           ((int)x.size())
#define sqr(x)          ( (x)* (x) )
#define eps             1e-9
#define lcm(x,y)        (abs(x) /gcd(x,y))* abs(y)
#define on(x,w)         x|(1<<w)
#define check(x,w)      (x&(1<<w))
#define all(x)          (x).begin(),(x).end()
#define pf              printf
#define sf              scanf
#define pi              acos(-1.0)
#define reset(x,v)      memset(x,v,sizeof(x));
#define AND             &&
#define OR              ||
#define what_is(x)      cerr<<#x<<" is "<<x<<"\n";

typedef long long ll;
typedef unsigned long long llu;

using namespace std;

template<class T>
inline T mod_v(T num)
{
    if(num>=0)
        return num%mod;
    else
        return (num%mod+mod)%mod;
}
template<class T>
inline T gcd(T a,T b)
{
    a=abs(a);
    b=abs(b);

    while(b) b ^= a ^= b ^= a %= b;
    return a;
}

template<class T>
T fast_pow(T n , T p)
{
    if(p==0) return 1;
    if(p%2)
    {
        T g=mod_v ( mod_v(n) * mod_v(fast_pow(n,p-1)) );
        return g;
    }
    else
    {
        T g=fast_pow(n,p/2);
        g=mod_v( mod_v(g) * mod_v(g) ) ;
        return g;
    }
}

template<class T>
inline T modInverse(T n)
{
    return fast_pow(n,mod-2);
}

template<class T>
inline void debug(string S1,T S2,string S3)
{
    cout<<S1<<S2<<S3;
}

bool equalTo ( double a, double b ){ if ( fabs ( a - b ) <= eps ) return true; else return false; }
bool notEqual ( double a, double b ){if ( fabs ( a - b ) > eps ) return true; else return false; }
bool lessThan ( double a, double b ){ if ( a + eps < b ) return true; else return false; }
bool lessThanEqual ( double a, double b ){if ( a < b + eps ) return true;   else return false;}
bool greaterThan ( double a, double b ){if ( a > b + eps ) return true;else return false;}
bool greaterThanEqual ( double a, double b ){if ( a + eps > b ) return true;else return false;}

template<class T>
inline int in(register T& num)
{
    register char c=0;
    num=0;
    bool n=false;
    while(c<33)c=getchar();
    while(c>33){
        if(c=='-')
            n=true;
        else num=num*10+c-'0';
        c=getchar();
    }
    num=n?-num:num;
    return 1;
}

/******* ! Code start from here ! *******/

 string s,t,m,z;
 int tmp;

bool test(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(mod_v(h1*31)+m[j] );
        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(mod_v(h2*31)+s[j] );
    }

    for(int j=mid-1;j<sz(s) && !ok;j++)
    {
        h2=mod_v(mod_v(h2*31)+s[j] );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-mod_v(p*s[j-mid+1] ) );
    }

    return ok;
}

bool test1(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(h1*31+(m[j]-'a') );

        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(h2*31+(z[j]-'a') );
    }

    for(int j=mid-1;j<sz(z) && !ok;j++)
    {
        h2=mod_v(h2*31+(z[j]-'a') );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-p*(z[j-mid+1]-'a')  );
    }

    return ok;
}

int main()
{
     std::ios_base::sync_with_stdio(false);

    #ifdef kimbbakar
        freopen ( "in.txt", "r", stdin );
//        freopen ( "out.txt", "w", stdout );
    #endif

    cin>>s>>t;

    z=s;

    reverse(all(z) );

    int i=0;

    vector<pair<int,int> >kp;

    while(i<sz(t))
    {
        m=t.substr(i,sz(t)-i);

        int l=0,r=sz(s);

        int res=0,fes=0;
        int p1,p2;

        while(l<=r)
        {
            int mid=(l+r)>>1;
            if(mid>sz(s) )
                r=mid;

            bool ok=test(mid);

            if(ok)
            {

                if(res<mid)
                {
                    p1=tmp;
                    res=mid;
                }
            }

            if(l==mid)
            {
                ok=test(r);

                if(ok)
                {
                    if(res<r)
                    {
                        p1=tmp;
                        res=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        l=0,r=sz(s);

        while(l<=r)
        {
            int mid=(l+r)>>1;

            if(mid>sz(z) )
                r=mid;

            bool ok=test1(mid);

            if(ok)
            {
                if(fes<mid)
                {
                    p2=tmp;
                    fes=mid;
                }
            }

            if(l==mid)
            {
                ok=test1(r);

                if(ok)
                {
                    if(fes<r)
                    {
                        p2=tmp;
                        fes=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        if(res==fes && res==0)
        {
            pf("-1\n");
            return 0;
        }

        if(res>=fes)
        {
            kp.pb(mp(p1+1,p1+res) );
            i+=res;
        }
        else
        {
            kp.pb(mp(sz(z)-p2,sz(z)-p2-fes+1 ) );
            i+=fes;
        }

    }

    pf("%d\n",sz(kp));

    for(int i=0;i<sz(kp);i++)
    {
        pf("%d %d\n",kp[i].F,kp[i].S);
    }

    return 0;
}


 /*
 Problem name :
 Algorithm : Not Sure Yet
 Contest/Practice :
 Source :
 Comment : Whenever you start to believe  yourself, people also start to believe in you
 Date : --
 Last Update : 25-Mar-2015
*/

/*
    SO STEP INSIDE/ SEE THE DEVIL IN I
    Too many times, we’ve let it come to this
    STEP INSIDE/ SEE THE DEVIL IN I
    Oh, when all that’s left does not make sense
    STEP INSIDE/ SEE THE DEVIL IN I
    I know you’ll find your answers in the end
    STEP INSIDE/ SEE THE DEVIL IN I
    You’ll realize I’m not your Devil… anymore

*/

#include<bits/stdc++.h>

#define pause           system("pause");
#define FOR(s,e,inc)    for(int i=s;i<=e;i+=inc)
#define mod             1000000007
#define inf             1<<30
#define pb              push_back
#define ppb             pop_back
#define mp              make_pair
#define F               first
#define S               second
#define sz(x)           ((int)x.size())
#define sqr(x)          ( (x)* (x) )
#define eps             1e-9
#define lcm(x,y)        (abs(x) /gcd(x,y))* abs(y)
#define on(x,w)         x|(1<<w)
#define check(x,w)      (x&(1<<w))
#define all(x)          (x).begin(),(x).end()
#define pf              printf
#define sf              scanf
#define pi              acos(-1.0)
#define reset(x,v)      memset(x,v,sizeof(x));
#define AND             &&
#define OR              ||
#define what_is(x)      cerr<<#x<<" is "<<x<<"\n";

typedef long long ll;
typedef unsigned long long llu;

using namespace std;

template<class T>
inline T mod_v(T num)
{
    if(num>=0)
        return num%mod;
    else
        return (num%mod+mod)%mod;
}
template<class T>
inline T gcd(T a,T b)
{
    a=abs(a);
    b=abs(b);

    while(b) b ^= a ^= b ^= a %= b;
    return a;
}

template<class T>
T fast_pow(T n , T p)
{
    if(p==0) return 1;
    if(p%2)
    {
        T g=mod_v ( mod_v(n) * mod_v(fast_pow(n,p-1)) );
        return g;
    }
    else
    {
        T g=fast_pow(n,p/2);
        g=mod_v( mod_v(g) * mod_v(g) ) ;
        return g;
    }
}

template<class T>
inline T modInverse(T n)
{
    return fast_pow(n,mod-2);
}

template<class T>
inline void debug(string S1,T S2,string S3)
{
    cout<<S1<<S2<<S3;
}

bool equalTo ( double a, double b ){ if ( fabs ( a - b ) <= eps ) return true; else return false; }
bool notEqual ( double a, double b ){if ( fabs ( a - b ) > eps ) return true; else return false; }
bool lessThan ( double a, double b ){ if ( a + eps < b ) return true; else return false; }
bool lessThanEqual ( double a, double b ){if ( a < b + eps ) return true;   else return false;}
bool greaterThan ( double a, double b ){if ( a > b + eps ) return true;else return false;}
bool greaterThanEqual ( double a, double b ){if ( a + eps > b ) return true;else return false;}

template<class T>
inline int in(register T& num)
{
    register char c=0;
    num=0;
    bool n=false;
    while(c<33)c=getchar();
    while(c>33){
        if(c=='-')
            n=true;
        else num=num*10+c-'0';
        c=getchar();
    }
    num=n?-num:num;
    return 1;
}

/******* ! Code start from here ! *******/

 string s,t,m,z;
 int tmp;

bool test(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(h1*31+(m[j]-'a') );

        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(h2*31+(s[j]-'a') );
    }

    for(int j=mid-1;j<sz(z) && !ok;j++)
    {
        h2=mod_v(h2*31+(s[j]-'a') );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-p*(s[j-mid+1]-'a')  );
    }

    return ok;
}

bool test1(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(h1*31+(m[j]-'a') );

        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(h2*31+(z[j]-'a') );
    }

    for(int j=mid-1;j<sz(z) && !ok;j++)
    {
        h2=mod_v(h2*31+(z[j]-'a') );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-p*(z[j-mid+1]-'a')  );
    }

    return ok;
}

int main()
{
     std::ios_base::sync_with_stdio(false);

    #ifdef kimbbakar
        freopen ( "in.txt", "r", stdin );
//        freopen ( "out.txt", "w", stdout );
    #endif

    cin>>s>>t;

    z=s;

    reverse(all(z) );

    int i=0;

    vector<pair<int,int> >kp;

    while(i<sz(t))
    {
        m=t.substr(i,sz(t)-i);

        int l=0,r=sz(s);

        int res=0,fes=0;
        int p1,p2;

        while(l<=r)
        {
            int mid=(l+r)>>1;
            if(mid>sz(s) )
                r=mid;

            bool ok=test(mid);

            if(ok)
            {

                if(res<mid)
                {
                    p1=tmp;
                    res=mid;
                }
            }

            if(l==mid)
            {
                ok=test(r);

                if(ok)
                {
                    if(res<r)
                    {
                        p1=tmp;
                        res=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        l=0,r=sz(s);

        while(l<=r)
        {
            int mid=(l+r)>>1;

            if(mid>sz(z) )
                r=mid;

            bool ok=test1(mid);

            if(ok)
            {
                if(fes<mid)
                {
                    p2=tmp;
                    fes=mid;
                }
            }

            if(l==mid)
            {
                ok=test1(r);

                if(ok)
                {
                    if(fes<r)
                    {
                        p2=tmp;
                        fes=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        if(res==fes && res==0)
        {
            pf("-1\n");
            return 0;
        }

        if(res>=fes)
        {
            kp.pb(mp(p1+1,p1+res) );
            i+=res;
        }
        else
        {
            kp.pb(mp(sz(z)-p2,sz(z)-p2-fes+1 ) );
            i+=fes;
        }

    }

    pf("%d\n",sz(kp));

    for(int i=0;i<sz(kp);i++)
    {
        pf("%d %d\n",kp[i].F,kp[i].S);
    }

    return 0;
}


 /*
 Problem name :
 Algorithm : Not Sure Yet
 Contest/Practice :
 Source :
 Comment : Whenever you start to believe  yourself, people also start to believe in you
 Date : --
 Last Update : 25-Mar-2015
*/

/*
    SO STEP INSIDE/ SEE THE DEVIL IN I
    Too many times, we’ve let it come to this
    STEP INSIDE/ SEE THE DEVIL IN I
    Oh, when all that’s left does not make sense
    STEP INSIDE/ SEE THE DEVIL IN I
    I know you’ll find your answers in the end
    STEP INSIDE/ SEE THE DEVIL IN I
    You’ll realize I’m not your Devil… anymore

*/

#include<bits/stdc++.h>

#define pause           system("pause");
#define FOR(s,e,inc)    for(int i=s;i<=e;i+=inc)
#define mod             1000000007
#define inf             1<<30
#define pb              push_back
#define ppb             pop_back
#define mp              make_pair
#define F               first
#define S               second
#define sz(x)           ((int)x.size())
#define sqr(x)          ( (x)* (x) )
#define eps             1e-9
#define lcm(x,y)        (abs(x) /gcd(x,y))* abs(y)
#define on(x,w)         x|(1<<w)
#define check(x,w)      (x&(1<<w))
#define all(x)          (x).begin(),(x).end()
#define pf              printf
#define sf              scanf
#define pi              acos(-1.0)
#define reset(x,v)      memset(x,v,sizeof(x));
#define AND             &&
#define OR              ||
#define what_is(x)      cerr<<#x<<" is "<<x<<"\n";

typedef long long ll;
typedef unsigned long long llu;

using namespace std;

template<class T>
inline T mod_v(T num)
{
    if(num>=0)
        return num%mod;
    else
        return (num%mod+mod)%mod;
}
template<class T>
inline T gcd(T a,T b)
{
    a=abs(a);
    b=abs(b);

    while(b) b ^= a ^= b ^= a %= b;
    return a;
}

template<class T>
T fast_pow(T n , T p)
{
    if(p==0) return 1;
    if(p%2)
    {
        T g=mod_v ( mod_v(n) * mod_v(fast_pow(n,p-1)) );
        return g;
    }
    else
    {
        T g=fast_pow(n,p/2);
        g=mod_v( mod_v(g) * mod_v(g) ) ;
        return g;
    }
}

template<class T>
inline T modInverse(T n)
{
    return fast_pow(n,mod-2);
}

template<class T>
inline void debug(string S1,T S2,string S3)
{
    cout<<S1<<S2<<S3;
}

bool equalTo ( double a, double b ){ if ( fabs ( a - b ) <= eps ) return true; else return false; }
bool notEqual ( double a, double b ){if ( fabs ( a - b ) > eps ) return true; else return false; }
bool lessThan ( double a, double b ){ if ( a + eps < b ) return true; else return false; }
bool lessThanEqual ( double a, double b ){if ( a < b + eps ) return true;   else return false;}
bool greaterThan ( double a, double b ){if ( a > b + eps ) return true;else return false;}
bool greaterThanEqual ( double a, double b ){if ( a + eps > b ) return true;else return false;}

template<class T>
inline int in(register T& num)
{
    register char c=0;
    num=0;
    bool n=false;
    while(c<33)c=getchar();
    while(c>33){
        if(c=='-')
            n=true;
        else num=num*10+c-'0';
        c=getchar();
    }
    num=n?-num:num;
    return 1;
}

/******* ! Code start from here ! *******/

 string s,t,m,z;
 int tmp;

bool test(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(mod_v(h1*31)+m[j] );
        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(mod_v(h2*31)+s[j] );
    }

    for(int j=mid-1;j<sz(s) && !ok;j++)
    {
        h2=mod_v(mod_v(h2*31)+s[j] );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-mod_v(p*s[j-mid+1] ) );
    }

    return ok;
}

bool test1(int mid)
{
    ll h1=0,h2=0;

    ll p=1;

    bool ok=false;

    for(int j=0;j<mid;j++)
    {
        h1=mod_v(mod_v(h1*31)+m[j] );

        if(j!=0)
        p=mod_v(p*31);
    }

    for(int j=0;j<mid-1;j++ )
    {
        h2=mod_v(mod_v(h2*31)+z[j] );
    }

    for(int j=mid-1;j<sz(z) && !ok;j++)
    {
        h2=mod_v(mod_v(h2*31)+z[j] );

        if(h2==h1)
        {
            tmp=j-mid+1;
            ok=true;
        }

        h2=mod_v(h2-mod_v(p*z[j-mid+1] ) );
    }

    return ok;
}

int main()
{
//     std::ios_base::sync_with_stdio(false);

    #ifdef kimbbakar
        freopen ( "in.txt", "r", stdin );
//        freopen ( "out.txt", "w", stdout );
    #endif

    cin>>s>>t;

    z=s;

    reverse(all(z) );

    int i=0;

    vector<pair<int,int> >kp;

    while(i<sz(t))
    {
        m=t.substr(i,sz(t)-i);

        int l=0,r=sz(s);

        int res=0,fes=0;
        int p1,p2;

        while(l<=r)
        {
            int mid=(l+r)>>1;
            if(mid>sz(s) )
                r=mid;

            bool ok=test(mid);

            if(ok)
            {

                if(res<mid)
                {
                    p1=tmp;
                    res=mid;
                }
            }

            if(l==mid)
            {
                ok=test(r);

                if(ok)
                {
                    if(res<r)
                    {
                        p1=tmp;
                        res=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        l=0,r=sz(s);

        while(l<=r)
        {
            int mid=(l+r)>>1;

            if(mid>sz(z) )
                r=mid;

            bool ok=test1(mid);

            if(ok)
            {
                if(fes<mid)
                {
                    p2=tmp;
                    fes=mid;
                }
            }

            if(l==mid)
            {
                ok=test1(r);

                if(ok)
                {
                    if(fes<r)
                    {
                        p2=tmp;
                        fes=r;
                    }
                }

                break;
            }

            if(ok)
                l=mid;
            else r=mid;

        }

        if(res==fes && res==0)
        {
            pf("-1\n");
            return 0;
        }

        if(res>=fes)
        {
            kp.pb(mp(p1+1,p1+res) );
            i+=res;
        }
        else
        {
            kp.pb(mp(sz(z)-p2,sz(z)-p2-fes+1 ) );
            i+=fes;
        }

    }

    pf("%d\n",sz(kp));

    for(int i=0;i<sz(kp);i++)
    {
        pf("%d %d\n",kp[i].F,kp[i].S);
    }

    return 0;
}


 /*
 Problem name :
 Algorithm : Not Sure Yet
 Contest/Practice :
 Source :
 Comment : Whenever you start to believe  yourself, people also start to believe in you
 Date : --
 Last Update : 25-Mar-2015
*/

/*
    SO STEP INSIDE/ SEE THE DEVIL IN I
    Too many times, weâve let it come to this
    STEP INSIDE/ SEE THE DEVIL IN I
    Oh, when all thatâs left does not make sense
    STEP INSIDE/ SEE THE DEVIL IN I
    I know youâll find your answers in the end
    STEP INSIDE/ SEE THE DEVIL IN I
    Youâll realize Iâm not your Devilâ¦ anymore

*/

#include<bits/stdc++.h>

#define pause           system("pause");
#define FOR(s,e,inc)    for(int i=s;i<=e;i+=inc)
#define mod             1000000007
#define inf             1<<30
#define pb              push_back
#define ppb             pop_back
#define mp              make_pair
#define F               first
#define S               second
#define sz(x)           ((int)x.size())
#define sqr(x)          ( (x)* (x) )
#define eps             1e-9
#define lcm(x,y)        (abs(x) /gcd(x,y))* abs(y)
#define on(x,w)         x|(1<<w)
#define check(x,w)      (x&(1<<w))
#define all(x)          (x).begin(),(x).end()
#define pf              printf
#define sf              scanf
#define pi              acos(-1.0)
#define reset(x,v)      memset(x,v,sizeof(x));
#define AND             &&
#define OR              ||
#define what_is(x)      cerr<<#x<<" is "<<x<<"\n";

typedef long long ll;
typedef unsigned long long llu;

using namespace std;

template<class T>
inline T mod_v(T num)
{
    if(num>=0)
        return num%mod;
    else
        return (num%mod+mod)%mod;
}
template<class T>
inline T gcd(T a,T b)
{
    a=abs(a);
    b=abs(b);

    while(b) b ^= a ^= b ^= a %= b;
    return a;
}

template<class T>
T fast_pow(T n , T p)
{
    if(p==0) return 1;
    if(p%2)
    {
        T g=mod_v ( mod_v(n) * mod_v(fast_pow(n,p-1)) );
        return g;
    }
    else
    {
        T g=fast_pow(n,p/2);
        g=mod_v( mod_v(g) * mod_v(g) ) ;
        return g;
    }
}

template<class T>
inline T modInverse(T n)
{
    return fast_pow(n,mod-2);
}

template<class T>
inline void debug(string S1,T S2,string S3)
{
    cout<<S1<<S2<<S3;
}

bool equalTo ( double a, double b ){ if ( fabs ( a - b ) <= eps ) return true; else return false; }
bool notEqual ( double a, double b ){if ( fabs ( a - b ) > eps ) return true; else return false; }
bool lessThan ( double a, double b ){ if ( a + eps < b ) return true; else return false; }
bool lessThanEqual ( double a, double b ){if ( a < b + eps ) return true;   else return false;}
bool greaterThan ( double a, double b ){if ( a > b + eps ) return true;else return false;}
bool greaterThanEqual ( double a, double b ){if ( a + eps > b ) return true;else return false;}

template<class T>
inline int in(register T& num)
{
    register char c=0;
    num=0;
    bool n=false;
    while(c<33)c=getchar();
    while(c>33){
        if(c=='-')
            n=true;
        else num=num*10+c-'0';
        c=getchar();
    }
    num=n?-num:num;
    return 1;
}

/******* ! Code start from here ! *******/

string s,t,m,g;
int tmp;
string x;
int z[100005];

int test()
{
    int l=0,r=0;

    z[0]=0;

    int ln=sz(x);

    int res=0;

    for(int i=1;i<ln;i++)
    {
        if(i>r)
        {
            l=r=i;

            while(r<ln && x[r-l]==x[r] ) r++;

            z[i]=r-l;
            r--; //("%d) %d(%d) %d(%c)\n",i,l,z[i],r,x[r]);

        }
        else
        {
            int k=i-l;

            if(z[k]<r-i+1)
            {
                z[i]=z[k];
            }
            else
            {
                l=i;
                while(r<ln && x[r-l]==x[r] ) r++;

                z[i]=r-l;
                r--;

            }
        }

        if(i>sz(m))
        {
            if(res<z[i])
            {
                tmp=i-sz(m)-1;
                res=z[i];
            }
        }
    }
    return res;
}

int main()
{
     std::ios_base::sync_with_stdio(false);

    #ifdef kimbbakar
        freopen ( "in.txt", "r", stdin );
//        freopen ( "out.txt", "w", stdout );
    #endif

    cin>>s>>t;

    g=s;

    reverse(all(g) );

    int i=0;

    vector<pair<int,int> >kp;

    while(i<sz(t))
    {
        m=t.substr(i,sz(t)-i);

        int l=0,r=sz(s);

        int res=0,fes=0;
        int p1,p2;

        x=m+"$"+s;

        res=test();
        p1=tmp;

        x=m+"$"+g;

        fes=test();
        p2=tmp;

        if(res==fes && res==0)
        {
            pf("-1\n");
            return 0;
        }

        if(res>=fes)
        {
            kp.pb(mp(p1+1,p1+res) );
            i+=res;
        }
        else
        {
            kp.pb(mp(sz(g)-p2,sz(g)-p2-fes+1 ) );
            i+=fes;
        }

    }

    pf("%d\n",sz(kp));

    for(int i=0;i<sz(kp);i++)
    {
        pf("%d %d\n",kp[i].F,kp[i].S);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int maxn=3000;
typedef pair <int,int> ii;
#define X first
#define Y second
string s,t;

long long hx[maxn],f[maxn],n,m,res[maxn][3],mu[maxn],spt,ht[3][maxn];

long long cals(int l, int r)
{
    return hx[r]-hx[l-1]*mu[r-l+1];
}

long long calt1(int l, int r)
{
    return ht[1][r]-ht[1][l-1]*mu[r-l+1];
}

long long calt2(int l, int r)
{
    return ht[2][r]-ht[2][l+1]*mu[l-r+1];
}

bool kt(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return true;
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return true;
    return false;
}

ii findpair(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return ii(i,i+len-1);
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return ii(i,i-len+1);
}

int main()
{
    cin >> s;
    cin >> t;
    n=s.length();
    m=t.length();
    s="-"+s;
    t="-"+t;
    mu[0]=1;
    for (int i=1; i<=m; ++i) hx[i]=hx[i-1]*37+t[i]-'a'+1;
    for (int i=1; i<=m; ++i) mu[i]=mu[i-1]*37;
    for (int i=1; i<=n; ++i) ht[1][i]=ht[1][i-1]*37+s[i]-'a'+1;
    for (int i=n; i>=1; --i) ht[2][i]=ht[2][i+1]*37+s[i]-'a'+1;
    for (int i=1; i<=m; ++i)
    {
        int j=i;
        while (j<=m && kt(j-i+1,i)) j++;
        j--;
        ii tmp=findpair(j-i+1,i);
        res[++spt][1]=tmp.X;
        res[spt][2]=tmp.Y;
        i=j;
    }
    cout << spt << endl;
    for (int i=1; i<=spt; ++i)
    {
        cout << res[i][1] << " " << res[i][2] << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;
const int maxn=3000;
typedef pair <int,int> ii;
#define X first
#define Y second
string s,t;

map <long long,ii> ma;

long long hx[maxn],f[maxn],n,m,res[maxn][3],mu[maxn],spt;

bool cnt(int i, int j)
{
    long long tmp=hx[j]-hx[i-1]*mu[j-i+1];
    return ma.count(tmp);
}

long long cunt(int i, int j)
{
    long long tmp=hx[j]-hx[i-1]*mu[j-i+1];
    return tmp;
}

int main()
{
    cin >> s;
    cin >> t;
    n=s.length();
    m=t.length();
    s="-"+s;
    t="-"+t;
    mu[0]=1;
    for (int i=1; i<=m; ++i) hx[i]=hx[i-1]*37+t[i]-'a'+1;
    for (int i=1; i<=m; ++i) mu[i]=mu[i-1]*37;
    for (int i=1; i<=n; ++i)
    {
        f[i-1]=0;
        for (int j=i; j<=n; ++j)
            f[j]=f[j-1]*37+s[j]-'a'+1, ma[f[j]]=ii(i,j);
    }
    for (int i=n; i>=1; --i)
    {
        f[i+1]=0;
        for (int j=i; j>=1; --j)
            f[j]=f[j+1]*37+s[j]-'a'+1, ma[f[j]]=ii(i,j);
    }

    for (int i=1; i<=m; ++i)
    {
        int j=i;
        while (j<=m && cnt(i,j)) j++;
        if (j==i) {cout << -1; return 0;}
        j--;
        ii tmp=ma[cunt(i,j)];
        res[++spt][1]=tmp.X;
        res[spt][2]=tmp.Y;
        i=j;
    }
    cout << spt << endl;
    for (int i=1; i<=spt; ++i)
    {
        cout << res[i][1] << " " << res[i][2] << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;
const int maxn=3000;
typedef pair <int,int> ii;
#define X first
#define Y second
string s,t;

long long hx[maxn],f[maxn],n,m,res[maxn][3],mu[maxn],spt,ht[3][maxn];

long long cals(int l, int r)
{
    return hx[r]-hx[l-1]*mu[r-l+1];
}

long long calt1(int l, int r)
{
    return ht[1][r]-ht[1][l-1]*mu[r-l+1];
}

long long calt2(int l, int r)
{
    return ht[2][r]-ht[2][l+1]*mu[l-r+1];
}

bool kt(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return true;
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return true;
    return false;
}

ii findpair(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return ii(i,i+len-1);
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return ii(i,i-len+1);
}

int main()
{
    cin >> s;
    cin >> t;
    n=s.length();
    m=t.length();
    s="-"+s;
    t="-"+t;
    mu[0]=1;
    for (int i=1; i<=m; ++i) hx[i]=hx[i-1]*37+t[i]-'a'+1;
    for (int i=1; i<=m; ++i) mu[i]=mu[i-1]*37;
    for (int i=1; i<=n; ++i) ht[1][i]=ht[1][i-1]*37+s[i]-'a'+1;
    for (int i=n; i>=1; --i) ht[2][i]=ht[2][i+1]*37+s[i]-'a'+1;
//    cout << kt(2,4);
    for (int i=1; i<=m; ++i)
    {
        int j=i;
        while (j<=m && kt(j-i+1,i)) j++;
        if (j==i) {cout << -1; return 0;}
        j--;
        ii tmp=findpair(j-i+1,i);
        res[++spt][1]=tmp.X;
        res[spt][2]=tmp.Y;
        i=j;
    }
    cout << spt << endl;
    for (int i=1; i<=spt; ++i)
    {
        cout << res[i][1] << " " << res[i][2] << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;
const int maxn=3000;
typedef pair <int,int> ii;
#define X first
#define Y second
string s,t;

long long hx[maxn],f[maxn],n,m,res[maxn][3],mu[maxn],spt,ht[3][maxn];

long long cals(int l, int r)
{
    return hx[r]-hx[l-1]*mu[r-l+1];
}

long long calt1(int l, int r)
{
    return ht[1][r]-ht[1][l-1]*mu[r-l+1];
}

long long calt2(int l, int r)
{
    return ht[2][r]-ht[2][l+1]*mu[l-r+1];
}

bool kt(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return true;
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return true;
}

ii findpair(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return ii(i,i+len-1);
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return ii(i,i-len+1);
}

int main()
{
    cin >> s;
    cin >> t;
    n=s.length();
    m=t.length();
    s="-"+s;
    t="-"+t;
    mu[0]=1;
    for (int i=1; i<=m; ++i) hx[i]=hx[i-1]*37+t[i]-'a'+1;
    for (int i=1; i<=m; ++i) mu[i]=mu[i-1]*37;
    for (int i=1; i<=n; ++i) ht[1][i]=ht[1][i-1]*37+t[i]-'a'+1;
    for (int i=n; i>=1; --i) ht[2][i]=ht[2][i+1]*37+t[i]-'a'+1;
//    cout << kt(2,4);
    for (int i=1; i<=m; ++i)
    {
        int j=i;
        while (j<=m && kt(j-i+1,i)) j++;
        j--;
        ii tmp=findpair(j-i+1,i);
        res[++spt][1]=tmp.X;
        res[spt][2]=tmp.Y;
        i=j;
    }
    cout << spt << endl;
    for (int i=1; i<=spt; ++i)
    {
        cout << res[i][1] << " " << res[i][2] << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;
const int maxn=3000;
typedef pair <int,int> ii;
#define X first
#define Y second
string s,t;

long long hx[maxn],f[maxn],n,m,res[maxn][3],mu[maxn],spt,ht[3][maxn];

long long cals(int l, int r)
{
    return hx[r]-hx[l-1]*mu[r-l+1];
}

long long calt1(int l, int r)
{
    return ht[1][r]-ht[1][l-1]*mu[r-l+1];
}

long long calt2(int l, int r)
{
    return ht[2][r]-ht[2][l+1]*mu[l-r+1];
}

bool kt(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return true;
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return true;
}

ii findpair(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return ii(i,i+len-1);
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return ii(i,i-len+1);
}

int main()
{
    cin >> s;
    cin >> t;
    n=s.length();
    m=t.length();
    s="-"+s;
    t="-"+t;
    mu[0]=1;
    for (int i=1; i<=m; ++i) hx[i]=hx[i-1]*37+t[i]-'a'+1;
    for (int i=1; i<=m; ++i) mu[i]=mu[i-1]*37;
    for (int i=1; i<=n; ++i) ht[1][i]=ht[1][i-1]*37+s[i]-'a'+1;
    for (int i=n; i>=1; --i) ht[2][i]=ht[2][i+1]*37+s[i]-'a'+1;
//    cout << kt(2,4);
    for (int i=1; i<=m; ++i)
    {
        int j=i;
        while (j<=m && kt(j-i+1,i)) j++;
        j--;
        ii tmp=findpair(j-i+1,i);
        res[++spt][1]=tmp.X;
        res[spt][2]=tmp.Y;
        i=j;
    }
    cout << spt << endl;
    for (int i=1; i<=spt; ++i)
    {
        cout << res[i][1] << " " << res[i][2] << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;
const int maxn=3000;
typedef pair <int,int> ii;
#define X first
#define Y second
string s,t;

long long hx[maxn],f[maxn],n,m,res[maxn][3],mu[maxn],spt,ht[3][maxn];

long long cals(int l, int r)
{
    return hx[r]-hx[l-1]*mu[r-l+1];
}

long long calt1(int l, int r)
{
    return ht[1][r]-ht[1][l-1]*mu[r-l+1];
}

long long calt2(int l, int r)
{
    return ht[2][r]-ht[2][l+1]*mu[l-r+1];
}

bool kt(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return true;
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return true;
}

ii findpair(int len, int vt)
{
    long long tmp=cals(vt,vt+len-1);
    for (int i=1; i<=n-len+1; ++i)
        if (calt1(i,i+len-1)==tmp) return ii(i,i+len-1);
    for (int i=n; i>=len; --i)
        if (calt2(i,i-len+1)==tmp) return ii(i,i-len+1);
}

int main()
{
    cin >> s;
    cin >> t;
    n=s.length();
    m=t.length();
    s="-"+s;
    t="-"+t;
    mu[0]=1;
    for (int i=1; i<=m; ++i) hx[i]=hx[i-1]*37+t[i]-'a'+1;
    for (int i=1; i<=m; ++i) mu[i]=mu[i-1]*37;
    for (int i=1; i<=n; ++i) ht[1][i]=ht[1][i-1]*37+s[i]-'a'+1;
    for (int i=n; i>=1; --i) ht[2][i]=ht[2][i+1]*37+s[i]-'a'+1;
//    cout << kt(2,4);
    for (int i=1; i<=m; ++i)
    {
        int j=i;
        while (j<=m && kt(j-i+1,i)) j++;
        if (j==i) {cout << -1; return 0;}
        j--;
        ii tmp=findpair(j-i+1,i);
        res[++spt][1]=tmp.X;
        res[spt][2]=tmp.Y;
        i=j;
    }
    cout << spt << endl;
    for (int i=1; i<=spt; ++i)
    {
        cout << res[i][1] << " " << res[i][2] << endl;
    }
}


/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
 * Created By : Vishwas Tripathi
 * CSE, MNNIT-ALLAHABAD
 * vishfrnds@gmail.com
 _._._._._._._._._._._._._._._._._._._._._.*/

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <set>
#include <assert.h>
using namespace std;

#define MP make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define PER(i,a,b) for(int i=b;i>=a;i--)
#define X first
#define Y second
#define all(c) c.begin(),c.end() //eg sort(all(v));

#define tr(c, itr) for(itr = (c).begin(); itr != (c).end(); itr++)
#define present(container, element) (container.find(element) != container.end()) //for set,map,etc
#define cpresent(container, element) (find(all(container),element) != container.end()) //for vectors

 typedef long long ll;
 typedef vector<int> vi;
 typedef vector< vi > vvi;
 typedef pair< int,int > ii;

#define sz(a) int((a).size())
#define clr(a) memset(a,0,sizeof(a))
#define ini(a) memset(a,-1,sizeof(a))

//i/o
#define inp(n) scanf("%d",&n)
#define inp2(n,m) inp(n), inp(m)
#define ins(s) scanf("%s",s);
#define out(n) printf("%d\n",n)
#define out2(n,m) printf("%d %d\n",n,m)
#define inc(n) scanf("%c",&n)

#define inll(n) scanf("%lld",&n)
#define inll2(n,m) scanf("%lld%lld",&n,&m)
#define outll(n) printf("%lld\n",n)
#define outll(n) printf("%lld\n",n)
#define outll2(n,m) printf("%lld %lld\n",n,m)

//cost
#define MOD 1000000007
#define MOD_INV 1000000006
#define MAX 100009
#define INF 999999999

#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl

#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
	const int MAXN = 3010;
	char S[MAXN];
	int N, gap;
	int sa[MAXN], pos[MAXN], tmp[MAXN], lcp[MAXN];

	bool sufCmp(int i, int j)
	{
		if (pos[i] != pos[j])
			return pos[i] < pos[j];
		i += gap;
		j += gap;
		return (i < N && j < N) ? pos[i] < pos[j] : i > j;
	}

	void buildSA()
	{
		N = strlen(S);
		REP(i, N) sa[i] = i, pos[i] = S[i];
		for (gap = 1;; gap *= 2)
		{
			sort(sa, sa + N, sufCmp);
			REP(i, N - 1) tmp[i + 1] = tmp[i] + sufCmp(sa[i], sa[i + 1]);
			REP(i, N) pos[sa[i]] = tmp[i];
			if (tmp[N - 1] == N - 1) break;
		}
	}

	void buildLCP()
	{
		for (int i = 0, k = 0; i < N; ++i) if (pos[i] != N - 1)
		{
			for (int j = sa[pos[i] + 1]; S[i + k] == S[j + k];)
			++k;
			lcp[pos[i]] = k;
			if (k)--k;
		}
	}

int fre[226];

int main()
{
	string a, b;
	cin >> a >> b;
	int x = a.length (), y = b.length ();
	rep (i, x) {
		fre[a[i]]++;
		S[i] = a[i];
	}
	S[x] = '~';
	rep (i, x) {
		S[x + 1 + i] = a[x - i - 1];
	}
	S[x + x + 1] = '~';
	bool ok = true;
	rep (i, y) {
		S[2 * x + 2 + i] = b[i];
		if (fre[b[i]] == 0)
			ok = false;
	}

	S[2 * x + y + 2] = '\0';
	if (!ok) {
		out (-1);
	}
	else {
		vector<pair<int, int> > ans;
		buildSA ();
		buildLCP ();
		int cur = 0;
		do {
			int r = pos[2 * x + 2 + cur];
			int l = lcp[r];
			int i = r + 1;
			//chk (r);
			for (; i < N; i++) {
				l = min (l, lcp[i - 1]);
				if (sa[i] < N - y)
					break;
			}
			//chk4 (cur, l, i, sa[i]);
			cur += l;
			if (sa[i] < x) {
				ans.pb (MP (sa[i] + 1, sa[i] + 1 + l - 1));
				//printf ("%d %d\n", sa[i] + 1, sa[i] + 1 + l - 1);
			}
			else {
				ans.pb (MP (x - (sa[i] - x) + 1, x - (sa[i] + l - x - 1) + 1));
				//printf ("%d %d\n", x - (sa[i] - x) + 1, x - (sa[i] + l - x - 1) + 1);
			}

		} while (cur < y);
		cout << ans.size () << "\n";
		rep (j, ans.size ())
			out2 (ans[j].X, ans[j].Y);
	}

    return 0;
}


/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
 * Created By : Vishwas Tripathi
 * CSE, MNNIT-ALLAHABAD
 * vishfrnds@gmail.com
 _._._._._._._._._._._._._._._._._._._._._.*/

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <set>
#include <assert.h>
using namespace std;

#define MP make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define PER(i,a,b) for(int i=b;i>=a;i--)
#define X first
#define Y second
#define all(c) c.begin(),c.end() //eg sort(all(v));

#define tr(c, itr) for(itr = (c).begin(); itr != (c).end(); itr++)
#define present(container, element) (container.find(element) != container.end()) //for set,map,etc
#define cpresent(container, element) (find(all(container),element) != container.end()) //for vectors

 typedef long long ll;
 typedef vector<int> vi;
 typedef vector< vi > vvi;
 typedef pair< int,int > ii;

#define sz(a) int((a).size())
#define clr(a) memset(a,0,sizeof(a))
#define ini(a) memset(a,-1,sizeof(a))

//i/o
#define inp(n) scanf("%d",&n)
#define inp2(n,m) inp(n), inp(m)
#define ins(s) scanf("%s",s);
#define out(n) printf("%d\n",n)
#define out2(n,m) printf("%d %d\n",n,m)
#define inc(n) scanf("%c",&n)

#define inll(n) scanf("%lld",&n)
#define inll2(n,m) scanf("%lld%lld",&n,&m)
#define outll(n) printf("%lld\n",n)
#define outll(n) printf("%lld\n",n)
#define outll2(n,m) printf("%lld %lld\n",n,m)

//cost
#define MOD 1000000007
#define MOD_INV 1000000006
#define MAX 100009
#define INF 999999999

#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl

#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
	const int MAXN = 3010;
	char S[MAXN];
	int N, gap;
	int sa[MAXN], pos[MAXN], tmp[MAXN], lcp[MAXN];

	bool sufCmp(int i, int j)
	{
		if (pos[i] != pos[j])
			return pos[i] < pos[j];
		i += gap;
		j += gap;
		return (i < N && j < N) ? pos[i] < pos[j] : i > j;
	}

	void buildSA()
	{
		N = strlen(S);
		REP(i, N) sa[i] = i, pos[i] = S[i];
		for (gap = 1;; gap *= 2)
		{
			sort(sa, sa + N, sufCmp);
			REP(i, N - 1) tmp[i + 1] = tmp[i] + sufCmp(sa[i], sa[i + 1]);
			REP(i, N) pos[sa[i]] = tmp[i];
			if (tmp[N - 1] == N - 1) break;
		}
	}

	void buildLCP()
	{
		for (int i = 0, k = 0; i < N; ++i) if (pos[i] != N - 1)
		{
			for (int j = sa[pos[i] + 1]; S[i + k] == S[j + k];)
			++k;
			lcp[pos[i]] = k;
			if (k)--k;
		}
	}

int fre[226];

int main()
{
	string a, b;
	cin >> a >> b;
	int x = a.length (), y = b.length ();
	rep (i, x) {
		fre[a[i]]++;
		S[i] = a[i];
	}
	S[x] = '~';
	rep (i, x) {
		S[x + 1 + i] = a[x - i - 1];
	}
	S[x + x + 1] = '~';
	bool ok = true;
	rep (i, y) {
		S[2 * x + 2 + i] = b[i];
		if (fre[b[i]] == 0)
			ok = false;
	}

	S[2 * x + y + 2] = '\0';
	if (!ok) {
		out (-1);
	}
	else {
		vector<pair<int, int> > ans;
		buildSA ();
		buildLCP ();
		int cur = 0;
		do {
			int r = pos[2 * x + 2 + cur];
			int l = lcp[r];
			int i = r + 1;
			int ii = r - 1;
			//chk (r);
			for (; i < N; i++) {
				l = min (l, lcp[i - 1]);
				if (sa[i] < N - y)
					break;
			}
			if (ii >= 0) {
				int ll = lcp[ii];
				for (;ii >= 0; ii--) {
					ll = min (ll, lcp[ii]);
					if (sa[ii] < N - y)
						break;
				}
				if (ii >= 0 && (i == N || ll > l)) {
					l = ll;
					i = ii;
				}
			}
			//chk4 (cur, l, i, sa[i]);
			cur += l;
			if (sa[i] < x) {
				ans.pb (MP (sa[i] + 1, sa[i] + 1 + l - 1));
				//printf ("%d %d\n", sa[i] + 1, sa[i] + 1 + l - 1);
			}
			else {
				ans.pb (MP (x - (sa[i] - x) + 1, x - (sa[i] + l - x - 1) + 1));
				//printf ("%d %d\n", x - (sa[i] - x) + 1, x - (sa[i] + l - x - 1) + 1);
			}

		} while (cur < y);
		cout << ans.size () << "\n";
		rep (j, ans.size ())
			out2 (ans[j].X, ans[j].Y);
	}

    return 0;
}


/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
 * Created By : Vishwas Tripathi
 * CSE, MNNIT-ALLAHABAD
 * vishfrnds@gmail.com
 _._._._._._._._._._._._._._._._._._._._._.*/

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <set>
#include <assert.h>
using namespace std;

#define MP make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define PER(i,a,b) for(int i=b;i>=a;i--)
#define X first
#define Y second
#define all(c) c.begin(),c.end() //eg sort(all(v));

#define tr(c, itr) for(itr = (c).begin(); itr != (c).end(); itr++)
#define present(container, element) (container.find(element) != container.end()) //for set,map,etc
#define cpresent(container, element) (find(all(container),element) != container.end()) //for vectors

 typedef long long ll;
 typedef vector<int> vi;
 typedef vector< vi > vvi;
 typedef pair< int,int > ii;

#define sz(a) int((a).size())
#define clr(a) memset(a,0,sizeof(a))
#define ini(a) memset(a,-1,sizeof(a))

//i/o
#define inp(n) scanf("%d",&n)
#define inp2(n,m) inp(n), inp(m)
#define ins(s) scanf("%s",s);
#define out(n) printf("%d\n",n)
#define out2(n,m) printf("%d %d\n",n,m)
#define inc(n) scanf("%c",&n)

#define inll(n) scanf("%lld",&n)
#define inll2(n,m) scanf("%lld%lld",&n,&m)
#define outll(n) printf("%lld\n",n)
#define outll(n) printf("%lld\n",n)
#define outll2(n,m) printf("%lld %lld\n",n,m)

//cost
#define MOD 1000000007
#define MOD_INV 1000000006
#define MAX 100009
#define INF 999999999

#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl

#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
	const int MAXN = 6400;
	char S[MAXN];
	int N, gap;
	int sa[MAXN], pos[MAXN], tmp[MAXN], lcp[MAXN];

	bool sufCmp(int i, int j)
	{
		if (pos[i] != pos[j])
			return pos[i] < pos[j];
		i += gap;
		j += gap;
		return (i < N && j < N) ? pos[i] < pos[j] : i > j;
	}

	void buildSA()
	{
		N = strlen(S);
		REP(i, N) sa[i] = i, pos[i] = S[i];
		for (gap = 1;; gap *= 2)
		{
			sort(sa, sa + N, sufCmp);
			REP(i, N - 1) tmp[i + 1] = tmp[i] + sufCmp(sa[i], sa[i + 1]);
			REP(i, N) pos[sa[i]] = tmp[i];
			if (tmp[N - 1] == N - 1) break;
		}
	}

	void buildLCP()
	{
		for (int i = 0, k = 0; i < N; ++i) if (pos[i] != N - 1)
		{
			for (int j = sa[pos[i] + 1]; S[i + k] == S[j + k];)
			++k;
			lcp[pos[i]] = k;
			if (k)--k;
		}
	}

int fre[226];

int main()
{
	string a, b;
	cin >> a >> b;
	int x = a.length (), y = b.length ();
	rep (i, x) {
		fre[a[i]]++;
		S[i] = a[i];
	}
	S[x] = '~';
	rep (i, x) {
		S[x + 1 + i] = a[x - i - 1];
	}
	S[x + x + 1] = '~';
	bool ok = true;
	rep (i, y) {
		S[2 * x + 2 + i] = b[i];
		if (fre[b[i]] == 0)
			ok = false;
	}

	S[2 * x + y + 2] = '\0';
	if (!ok) {
		out (-1);
	}
	else {
		vector<pair<int, int> > ans;
		buildSA ();
		buildLCP ();
		int cur = 0;
		do {
			int r = pos[2 * x + 2 + cur];
			int l = lcp[r];
			int i = r + 1;
			int ii = r - 1;
			//chk (r);
			for (; i < N; i++) {
				l = min (l, lcp[i - 1]);
				if (sa[i] < N - y)
					break;
			}
			if (ii >= 0) {
				int ll = lcp[ii];
				for (;ii >= 0; ii--) {
					ll = min (ll, lcp[ii]);
					if (sa[ii] < N - y)
						break;
				}
				if (ii >= 0 && (i == N || ll > l)) {
					l = ll;
					i = ii;
				}
			}
			//chk4 (cur, l, i, sa[i]);
			cur += l;
			if (sa[i] < x) {
				ans.pb (MP (sa[i] + 1, sa[i] + 1 + l - 1));
				//printf ("%d %d\n", sa[i] + 1, sa[i] + 1 + l - 1);
			}
			else {
				ans.pb (MP (x - (sa[i] - x) + 1, x - (sa[i] + l - x - 1) + 1));
				//printf ("%d %d\n", x - (sa[i] - x) + 1, x - (sa[i] + l - x - 1) + 1);
			}

		} while (cur < y);
		cout << ans.size () << "\n";
		rep (j, ans.size ())
			out2 (ans[j].X, ans[j].Y);
	}

    return 0;
}