#include <iostream>
#include <string>
using namespace std;

int main()
{
    long long num, one, two, i, j, z = 0;
    bool stop = 0;
    char word[1000];
    cin >> num >> one >> two;
    for (int i = 0; i<num; i++)
    {
        cin >> word[i];
    }
    if (one + two == num)
    {
        cout << 2 << endl;
        for (int i = 0; i<one; i++)
        {
            cout << word[i];
        }
        cout << endl;
        for (int i = one; i<num; i++)
        {
            cout << word[i];
        }
    }
    else if (one+two<num)
    {
        if (one >= two)
        {
            for (i = 0; i <= num; i++)
            {
                for (j = 0; i <= num; j++)
                {
                    if ((i*two) + (j*one) == num)
                    {
                        stop = 1;
                        break;
                    }
                    if ((i*two) + (j*one) > num)
                    {

                        break;
                    }
                }
                if (stop == 1)
                {
                    break;
                }

            }
            if (stop == 1)
            {
                cout << i + j << endl;

                for (int a = 1; a <= j; a++)
                {
                    for (int q = z; z<a*one; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*one);
                }
                z = 0;
                for (int a = 1; a <= i; a++)
                {
                    for (int q = z; z<a*two; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*two);
                }
            }
            else if(stop==0)
            {
                cout << -1;
            }

        }
        else
        {
            for (i = 0; i <= num; i++)
            {
                for (j = 0; i <= num; j++)
                {
                    if ((j*two) + (i*one) == num)
                    {
                        stop = 1;
                        break;
                    }
                    if ((j*two) + (i*one) > num)
                    {

                        break;
                    }
                }
                if (stop == 1)
                {
                    break;
                }
            }
            if (stop == 1)
            {
                cout << i + j << endl;
                z = 0;
                for (int a = 1; a <= i; a++)
                {
                    for (int q = z; z<a*one; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*one);
                }
                z = 0;
                for (int a = 1; a <= j; a++)
                {
                    for (int q = z; z<a*two; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*two);
                }
            }
            else if(stop==0)
            {
                cout << -1;
            }
        }
    }
    else if (one + two>num)
    {
        if (one >= two)
        {
            for (i = 0; i <= num; i++)
            {
                for (j = 0; i <= num; j++)
                {
                    if ((j*two) + (i*one) == num)
                    {
                        stop = 1;
                        break;
                    }
                    if ((j*two) + (i*one) > num)
                    {

                        break;
                    }
                }
                if (stop == 1)
                {
                    break;
                }

            }
            if (stop == 1)
            {
                cout << i + j << endl;

                for (int a = 1; a <= i; a++)
                {
                    for (int q = z; z<a*one; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*one);
                }
                z = 0;
                for (int a = 1; a <= j; a++)
                {
                    for (int q = z; z<a*two; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*two);
                }
            }
            else
            {
                cout << -1;
            }

        }
        else
        {
            for (i = 0; i <= num; i++)
            {
                for (j = 0; i <= num; j++)
                {
                    if ((i*two) + (j*one) == num)
                    {
                        stop = 1;
                        break;
                    }
                    if ((i*two) + (j*one) > num)
                    {

                        break;
                    }
                }
                if (stop == 1)
                {
                    break;
                }
            }
            if (stop == 1)
            {
                cout << i + j << endl;
                z = 0;
                for (int a = 1; a <= j; a++)
                {
                    for (int q = z; z<j*one; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (j*one);
                }
                z = 0;
                for (int a = 1; a <= i; a++)
                {
                    for (int q = z; z<i*two; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (i*two);
                }
            }
            else
            {
                cout << -1;
            }
        }
    }
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
    long long num, one, two, i, j, z = 0;
    bool stop = 0;
    char word[1000];
    cin >> num >> one >> two;
    for (int i = 0; i < num; i++)
    {
        cin >> word[i];
    }
    if (one + two == num)
    {
        cout << 2 << endl;
        for (int i = 0; i < one; i++)
        {
            cout << word[i];
        }
        cout << endl;
        for (int i = one; i < num; i++)
        {
            cout << word[i];
        }
    }
    else if (one + two<num)
    {
        if (one >= two)
        {
            for (i = 0; i <= num; i++)
            {
                if ((i*two) == num)
                {
                    stop = 1;
                    break;
                }
                if ((i*two) > num)
                {

                    break;
                }
            }

            if (stop == 1)
            {
                cout << i << endl;

                z = 0;
                for (int a = 1; a <= i; a++)
                {
                    for (int q = z; z < a*two; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*two);
                }
            }
            else if (stop == 0)
            {
                cout << -1;
            }
        }
        else
        {
            for (i = 0; i <= num; i++)
            {
                if ((i*one) == num)
                {
                    stop = 1;
                    break;
                }
                if ((i*one) > num)
                {

                    break;
                }
            }

            if (stop == 1)
            {
                cout << i << endl;
                z = 0;
                for (int a = 1; a <= i; a++)
                {
                    for (int q = z; z < a*one; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*one);
                }
            }
            else if (stop == 0)
            {
                cout << -1;
            }
        }
    }
    else if (one + two>num)
    {
        if (one <= two)
        {
            for (i = 0; i <= num; i++)
            {

                    if ( (i*one) == num)
                    {
                        stop = 1;
                        break;
                    }
                    if ((i*one) > num)
                    {

                        break;
                    }

            }
            if (stop == 1)
            {
                cout << i << endl;

                for (int a = 1; a <= i; a++)
                {
                    for (int q = z; z<a*one; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*one);
                }
            }
            else
            {
                cout << -1;
            }

        }
        else
        {
            for (i = 0; i <= num; i++)
            {

                    if ((i*two)  == num)
                    {
                        stop = 1;
                        break;
                    }
                    if ((i*two) > num)
                    {

                        break;
                    }
            }
            if (stop == 1)
            {
                cout << i << endl;
                z = 0;
                for (int a = 1; a <= i; a++)
                {
                    for (int q = z; z<a*two; z++)
                    {
                        cout << word[z];
                    }
                    cout << endl;
                    z = (a*two);
                }
            }
            else
            {
                cout << -1;
            }
        }
    }
    return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;
typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	string ans="";
	int y=0;
	int x=0;

	for(int I=0;I<101;I++) {
		int tmp=(n-(p*I));
		int b=tmp/q;
		if(tmp%q==0 && b>-1){
			x=I;
			y=b;
			break;
		}
	}

	if(x+y==0)cout << -1 << endl;
	else {
		cout << (x+y) << endl;
		for(int I=0;I<x;I++){
			ans+=str.substr(I*p,p)+"\n";
		}
		for(int I=0;I<y;I++){
			ans+=str.substr(I*q+(x*p),q)+"\n";
		}

		cout << ans;

	}

	return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;
typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	string ans="";
	int y=0;
	int x=0;

	for(int I=0;I<101;I++) {
		int tmp=(n-(p*I));
		int b=tmp/q;
		if(tmp%q==0){
			x=I;
			y=b;
			break;
		}
	}

	if(x+y==0)cout << -1 << endl;
	else {
		cout << (x+y) << endl;
		for(int I=0;I<x;I++){
			ans+=str.substr(I*p,p)+"\n";
		}
		for(int I=0;I<y;I++){
			ans+=str.substr(I*q+(x*p),q)+"\n";
		}

		cout << ans;

	}

	return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	if(n%(p+q)!=0 && n%p!=0 && n%q!=0)printf("-1");
	else if(n%(p+q)==0){
		//char ans[500];
		string ans="";
		int length=0;

		int parts=0;
		int count=0;
		for(int I=0;I<n;I++){
			//ans[length++]=word[I];
			ans+=word[I];
			count++;
			if(count==q && (n-(I+1))%p==0){
				//ans[length++]='\n';
				ans+='\n';
				parts++;
				count=0;
			} else if(count==p && (n-(I+1))%q==0){
				//ans[length++]='\n';
				ans+='\n';
				parts++;
				count=0;
			}
		}
		cout << parts << endl;
		//cout << string(ans) << endl;
		cout << ans << endl;

	} else if(n%p==0) {
		//char ans[500];
		string ans="";
		int length=0;

		int parts=0;
		int count=0;
		for(int I=0;I<n;I++){
			//ans[length++]=word[I];
			ans+=word[I];
			count++;
			if(count==p && (n-(I+1))%p==0){
				//ans[length++]='\n';
				ans+='\n';
				parts++;
				count=0;
			}
		}
		cout << parts << endl;
		//cout << string(ans) << endl;
		cout << ans << endl;

	} else if(n%q==0) {
		//char ans[500];
		string ans="";
		int length=0;

		int parts=0;
		int count=0;
		for(int I=0;I<n;I++){
			//ans[length++]=word[I];
			ans+=word[I];
			count++;
			if(count==q && (n-(I+1))%q==0){
				//ans[length++]='\n';
				ans+='\n';
				parts++;
				count=0;
			}
		}
		cout << parts << endl;
		//cout << string(ans) << endl;
		cout << ans << endl;
	}
	return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	string ans="";
	int parts=0;
	int count=0;

	for(int I=0; I < n;I++) {
		ans+=word[I];
		count++;
		if(count == p && (n-(I+1)) % q ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count == q && (n-(I+1)) % p ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count == p && (n-(I+1)) % p ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count == q && (n-(I+1)) % q ==0) {
			ans+="\n";
			parts++;
			count=0;
		}

	}

	if(parts > 0) {
		cout << parts << endl;
		cout << ans << endl;
	} else cout << -1 << endl;

	return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;
typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	string ans="";
	int parts=0;
	int count=0;

	for(int I=0; I < n;I++) {
		ans+=word[I];
		count++;
		if(count == p && (n-(I+1)) % q ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count == q && (n-(I+1)) % p ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count == p && (n-(I+1)) % p ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count == q && (n-(I+1)) % q ==0) {
			ans+="\n";
			parts++;
			count=0;
		}

	}

	if(parts > 0) {
		cout << parts << endl;
		cout << ans << endl;
	} else cout << -1 << endl;

	return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;
typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	string ans="";
	int parts=0;
	int count=0;

	for(int I=0; I < n;I++) {
		ans+=word[I];
		count++;
		if(count == p && (n-(I+1)) % q ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count == q && (n-(I+1)) % p ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count == p && (n-(I+1)) % p ==0) {
			ans+="\n";
			parts++;
			count=0;
		} else if(count==q && (n-(I+1)) % q ==0) {
			ans+="\n";
			parts++;
			count=0;
		}

	}

	if(parts>0) {
		cout << parts << endl;
		cout << ans << endl;
	} else cout << -1 << endl;

	return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	if(p+q>n && p+p >n && q+q >n)printf("-1");
	else if(p+q==n){
		if(p==q)printf("2\n");
		else printf("2\n");

		int minv=min(p,q);

		cout << str.substr(0,minv) << endl;
		cout << str.substr(minv,n-1) << endl;

	} else if(p+p==n){
		cout << 2 << endl;
		cout << str.substr(0,p).data() << endl;
		cout << str.substr(p,n).data() << endl;

	} else if(q+q==n){
		cout << 2 << endl;
		cout << str.substr(0,q) << endl;
		cout << str.substr(q,n) << endl;
	} else if(q==n){
		cout << 1 << endl;
		cout << str << endl;
	} else if(p==n){
		cout << 1 << endl;
		cout << str << endl;
	}

	return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;
typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	string ans="";
	int y=0;
	int x=0;

	for(int I=0;I<101;I++) {
		int tmp=(n-(p*I));
		int b=tmp/q;
		if(tmp%q==0){
			x=I;
			y=b;
			break;
		}
	}

	if(x+y==0)cout << -1 << endl;
	else {
		cout << (x+y) << endl;
		for(int I=0;I<x;I++){
			ans+=str.substr(I*p,p)+"\n";
		}
		for(int I=0;I<y;I++){
			ans+=str.substr(I*q,q)+"\n";
		}

		cout << ans;

	}

	return 0;
}


//============================================================================
// Name        : CodeForces.cpp
// Author      : Jos Ral Prez Rodrguez
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
#include <string.h>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

typedef long long int int64;

int main() {

	//freopen("input","r",stdin);

	int n,p,q;
	scanf("%d %d %d",&n,&p,&q);

	char word[n+1];
	scanf("%s",word);

	string str(word);

	if(p+q>n && p+p >n && q+q >n)printf("-1");
	else if(p+q==n){
		if(p==q)printf("1\n");
		else printf("2\n");

		int minv=min(p,q);

		cout << str.substr(0,minv) << endl;
		cout << str.substr(minv,n-1) << endl;

	} else if(p+p==n){
		cout << 2 << endl;
		cout << str.substr(0,p).data() << endl;
		cout << str.substr(p,n).data() << endl;

	} else if(q+q==n){
		cout << 2 << endl;
		cout << str.substr(0,q) << endl;
		cout << str.substr(q,n) << endl;
	} else if(q==n){
		cout << 1 << endl;
		cout << str << endl;
	} else if(p==n){
		cout << 1 << endl;
		cout << str << endl;
	}

	return 0;
}


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

typedef long long ll;
ll gcd ( ll a, ll b )
{
  if ( a==0 ) return b;
  return gcd ( b%a, a );
}

int main() {
    long long t,n,i,k=0,p,x,j,a,b,q;
    string s;
    cin>>n>>p>>q>>s;
    for(i=0;i<n;i+=p)
    {
        if((n-i) % q ==0)
        {
            cout<<(i/p)+(n-i)/q<<endl;
            k=1;
            for(j=0;j<i;j++)
            {

                cout<<s[j];
                if(j%p==p-1 )
                cout<<endl;
            }
            for(j=i;j<n;j++)
            {
                cout<<s[j];
                if((j-i) % q == q-1)
                cout<<endl;
            }
        }
    }
    if(k==0)
    cout<<"-1"<<endl;

    return 0;
}


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

typedef long long ll;
ll gcd ( ll a, ll b )
{
  if ( a==0 ) return b;
  return gcd ( b%a, a );
}

int main() {
    long long t,n,i,k=0,p,x,j,a,b,q;
    string s;
    cin>>n>>p>>q>>s;
    for(i=0;i<n;i+=p)
    {
        if((n-i) % q ==0)
        {
            cout<<(i/p)+((n-i)/q)<<endl;
            k=1;
            for(j=0;j<i;j++)
            {

                cout<<s[j];
                if( (j%p) == (p-1) )
                cout<<endl;
            }
            for(j=i;j<n;j++)
            {
                cout<<s[j];
                if((j-i) % q == q-1)
                cout<<endl;
            }
        }
    }
    if(k==0)
    cout<<"-1"<<endl;

    return 0;
}


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

typedef long long ll;
ll gcd ( ll a, ll b )
{
  if ( a==0 ) return b;
  return gcd ( b%a, a );
}

int main() {
    long long t,n,i,k=0,p,x,j,a,b,q;
    string s;
    cin>>n>>p>>q>>s;
    for(i=0;i<n;i+=p)
    {
        if((n-i) % q ==0)
        {

            k=1;
            for(j=0;j<i;j++)
            {

                cout<<s[j];
                if(j%p==p-1 )
                cout<<endl;
            }
            for(j=i;j<n;j++)
            {
                cout<<s[j];
                if((j-i) % q == q-1)
                cout<<endl;
            }
        }
    }
    if(k==0)
    cout<<"-1"<<endl;

    return 0;
}


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

typedef long long ll;
ll gcd ( ll a, ll b )
{
  if ( a==0 ) return b;
  return gcd ( b%a, a );
}

int main() {
    long long t,n,i,k=0,p,x,j,a,b,q;
    string s;
    cin>>n>>p>>q>>s;
    for(i=0;i<=n;i+=p)
    {
        if((n-i) % q ==0)
        {
            cout<<(i/p)+((n-i)/q)<<endl;
            k=1;
            for(j=0;j<i;j++)
            {

                cout<<s[j];
                if( (j%p) == (p-1) )
                cout<<endl;
            }
            for(j=i;j<n;j++)
            {
                cout<<s[j];
                if((j-i) % q == q-1)
                cout<<endl;
            }
        }
    }
    if(k==0)
    cout<<"-1"<<endl;
    else
    cout<<endl;

    return 0;
}


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

typedef long long ll;
ll gcd ( ll a, ll b )
{
  if ( a==0 ) return b;
  return gcd ( b%a, a );
}

int main() {
    long long t,n,i,k=0,p,x,j,a,b,q;
    string s;
    cin>>n>>p>>q>>s;
    for(i=0;i<=n;i+=p)
    {
        if((n-i) % q ==0)
        {
            cout<<(i/p)+((n-i)/q)<<endl;
            k=1;
            for(j=0;j<i;j++)
            {

                cout<<s[j];
                if( (j%p) == (p-1) )
                cout<<endl;
            }
            for(j=i;j<n;j++)
            {
                cout<<s[j];
                if((j-i) % q == q-1)
                cout<<endl;
            }
            goto a;
        }
    }
    a:if(k==0)
    cout<<"-1"<<endl;
    else
    cout<<endl;

    return 0;
}


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

typedef long long ll;
ll gcd ( ll a, ll b )
{
  if ( a==0 ) return b;
  return gcd ( b%a, a );
}

int main() {
    long long t,n,i,k=0,p,x,j,a,b,q;
    string s;
    cin>>n>>p>>q>>s;
    for(i=0;i<n;i+=p)
    {
        if((n-i) % q ==0)
        {
            cout<<(i/p)+((n-i)/q)<<endl;
            k=1;
            for(j=0;j<i;j++)
            {

                cout<<s[j];
                if( (j%p) == (p-1) )
                cout<<endl;
            }
            for(j=i;j<n;j++)
            {
                cout<<s[j];
                if((j-i) % q == q-1)
                cout<<endl;
            }
        }
    }
    if(k==0)
    cout<<"-1"<<endl;
    else
    cout<<endl;

    return 0;
}


#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

string s;
int main()
{
    int n,p,q,k;
    cin>>n>>p>>q;
    cin>>s;
    for(int i=0;i<105;i++)
    {
        for(int j=0;j<105;j++)
        {
            if(i*p+j*q==n)
            {
                cout<<i+j<<endl;
                k=0;
                while(i--)
                {
                    cout<<s.substr(k,p)<<endl;
                    k+=p;
                }
                while(j--)
                {
                    cout<<s.substr(k,q)<<endl;
                    k+=q;
                }
                return 0;
            }
        }
    }
    return puts("-1");
}


#include <iostream>

using namespace std;

int n,p,q;
int h,i,j;
char a[100];
int main()
{
    while(cin>>n>>p>>q)
    {
        int c=-1;
        for(i=0;i<n;i++)
            cin >> a[i];
        if(p==q)
        {
            if(n%p==0)
            {
                c=1;
                cout << n/p << endl;
                for(i=0;i<n/p;i+=p)
                {
                    for(j=i;j<i+p;j++)
                        cout << a[j];
                    cout << endl;
                }
            }
        }
        else
        switch(n%p)
        {
        case (0):
            c=1;
            cout << n/p << endl;
            for(i=0;i<n/p;i+=p)
            {
                for(j=i;j<i+p;j++)
                    cout << a[j];
                cout << endl;
            }
        default:
            for(h=0;h<=(n-1)/p;h++)
                if((n-h*p)%q==0)
                {
                    c=1;
                    cout << h+(n-h*p)/q << endl;
                    for(i=0;i<h;i++)
                    {
                        for(j=i;j<i+p;j++)
                            cout << a[j];
                        cout << endl;
                    }
                    for(i=h;i<h+(n-h*p)/q;i++)
                    {
                        for(j=i;j<i+q;j++)
                            cout << a[j];
                        cout << endl;
                    }
                }
        }
            if(c==-1)
                cout << c <<endl;
    }
    return 0;
}


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

int main(){
    string s;
    int n, p, q;
    int px, qy;
    cin >>n >>p >>q;
    cin >> s;
    int len1 = n/p;
    bool flag=false;
    for(int x=0; x <= len1; x++)
    {
        if((n-p*x) % q == 0)
        {
            flag = true;
            px = x, qy = (n-p*x) / q;
        }
    }
    if(!flag)
    {
        cout<<-1;
        return 0;
    }
    cout<<px+qy<<'\n';
    for(int i=0; i<px; i++)
    {
        for(int j=0; j<p; j++) cout<< s[j+i*p];
        cout<<'\n';
    }
    for(int i=0; i<qy; i++)
    {
        for(int j=0; j<q; j++) cout<<s[p*px + j + i*q];
        cout<<'\n';
    }

    return 0;
}


#include <iostream>
#include <string>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cstring>
#define pi 3.1415926
using namespace std;
int main()
{
    string s;
    int x,y,z;
    while(cin>>x>>y>>z){
        cin>>s;
        int i,j,judge=0;
        for(i=0;i<=100&&judge==0;i++){
            for(j=0;j<=100&&judge==0;j++)
                if(x==y*i+z*j)judge=1;
        }
        i--;j--;
        if(judge==1){
        cout<<i+j<<endl;
        int cnt=0,m,n;
        for(n=0;n<i;n++){
            for(m=0;m<y;m++)
                cout<<s[cnt++];
            cout<<endl;
        }
        for(n=0;n<j;n++){
            for(m=0;m<z;m++)
                cout<<s[cnt++];
            cout<<endl;
        }
        }
        else cout<<-1<<endl;
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;

char str[11111];
int main()
{
    int n,p,q;
    scanf("%d%d%d",&n,&p,&q);
    scanf("%s",str);
    if(0==n%p)
    {
        printf("%d\n",n/p);
        for(int i=1;i<=n;i++)
        {
            printf("%c",str[i-1]);
            if(i%p==0) printf("\n");
        }
    }else if(0==n%q)
    {
        printf("%d\n",n/q);
        for(int i=1;i<=n;i++)
        {
            printf("%c",str[i-1]);
            if(i%q==0) printf("\n");
        }
    }else{
        int x,y;
        int flag=0;
        for(int i=0;i<=100;i++){
            for(int j=0;j<=100;j++){
                if(i*p+j*q==n)
                {
                    flag=1;x=i;y=j;
                }
            }
            if(1==flag) break;
        }
        if(0==flag) printf("-1\n");
        else{
            printf("%d\n",x+y);
            for(int i=1;i<=x*p;i++)
            {
                printf("%c",str[i-1]);
                if(0==i%p) printf("\n");
            }
            for(int i=x*p+1;i<=n;i++){
                printf("%c",str[i-1]);
                if(0==(i-x*p)%q) printf("\n");
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a,b,na,nb;
bool f(int n){
    if(n==0){
        return true;
    }
    bool s = false;
    if(n-a >= 0){
        na++;
        s = f(n-a);
        if(!s)
            na--;
    }
    if(!s && n-b >=0){
        nb++;
        s = f(n-b);
        if(!s) nb--;
    }
    return s;
}
int main(){
    int n;
    string s;
    cin>>n>>a>>b>>s;
    if(n%b == 0){
        cout<<n/b<<endl;
        for(int i=0 ; i<n/b ; i++){
            string s1 = s.substr(i,i+b);
            cout<<s1<<endl;
        }
    }
    else if(n%a == 0){
         cout<<n/a<<endl;
        for(int i=0 ; i<n/a ; i++){
            string s1 = s.substr(i,i+a);
            cout<<s1<<endl;
        }
    }
    else{
        if(f(n)){
            cout<<na+nb<<endl;
            int j=0;
            string s1;
            for(j=0 ; j<na ; j++){
                s1 = s.substr(j,j+a);
                cout<<s1<<endl;
            }
            for( ; j<nb ; j++){
                s1 = s.substr(j,j+b);
                cout<<s1<<endl;
            }

        }
else
cout<<-1;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){

    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    string s;
    cin>>s;
    int t = min(a,b);
    int y = n/t;
    if(y < 2 ){
        printf("-1");
    }
    else{
        printf("%d\n",y);
        int j;
        for(int i=0 ; i<y-1 ; i++){
            for(j=i*t ; j<(i+1)*t ; j++)
                printf("%c",s[j]);
            printf("\n");
        }
        for(int k=j ; k<n ; k++)
            printf("%c",s[k]);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a,b,na,nb;
bool f(int n){
    if(n==0){
        return true;
    }
    bool s = false;
    if(n-a >= 0){
        na++;
        s = f(n-a);
        if(!s)
            na--;
    }
    if(!s && n-b >=0){
        nb++;
        s = f(n-b);
        if(!s) nb--;
    }
    return s;
}
int main(){
    int n;
    string s;
    cin>>n>>a>>b>>s;
    if(n%b == 0){
        cout<<n/b<<endl;
        for(int i=0 ; i<n/b ; i++){
            string s1 = s.substr(i*b,i*b+b);
            cout<<s1<<endl;
        }
    }
    else if(n%a == 0){
         cout<<n/a<<endl;
        for(int i=0 ; i<n/a ; i++){
            string s1 = s.substr(i*a,i*a+a);
            cout<<s1<<endl;
        }
    }
    else{
        if(f(n)){
            cout<<na+nb<<endl;
            int j=0;
            string s1;
            for(j=0 ; j<na ; j++){
                s1 = s.substr(j*a,j*a+a);
                cout<<s1<<endl;
            }
int z = j*a;
            for(int j1=0 ; j1<nb ; j1++){
                s1 = s.substr(z+j1*b,z+j1*b+b);
                cout<<s1<<endl;
            }

        }
else
cout<<-1;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a,b,na,nb;
bool f(int n){
    if(n==0){
        return true;
    }
    bool s = false;
    if(n-a >= 0){
        na++;
        s = f(n-a);
        if(!s)
            na--;
    }
    if(!s && n-b >=0){
        nb++;
        s = f(n-b);
        if(!s) nb--;
    }
    return s;
}
int main(){
    int n;
    string s;
    cin>>n>>a>>b>>s;
    if(n%b == 0){
        cout<<n/b<<endl;
        for(int i=0 ; i<n/b ; i++){
            string s1 = s.substr(i,i+b);
            cout<<s1<<endl;
        }
    }
    else if(n%a == 0){
         cout<<n/a<<endl;
        for(int i=0 ; i<n/a ; i++){
            string s1 = s.substr(i,i+a);
            cout<<s1<<endl;
        }
    }
    else{
        if(f(n)){
            cout<<na+nb<<endl;
            int j=0;
            string s1;
            for(j=0 ; j<na ; j++){
                s1 = s.substr(j,j+a);
                cout<<s1<<endl;
            }
            for( ; j<nb+na ; j++){
                s1 = s.substr(j,j+b);
                cout<<s1<<endl;
            }

        }
else
cout<<-1;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int a,b,n;
int res1,res2;
bool dp(int x , int y , int m){
    if(m == 0){
        res1 = x;
        res2 = y;
        return true;
    }
    else if(m<0){
        return false;
    }

    bool res = dp(x+1,y,m-a);
    if(!res)
        res = dp(x,y+1,m-b);

    return res;
}

int main(){

    scanf("%d%d%d",&n,&a,&b);
    string s;
    cin>>s;
    if(dp(0,0,n)){
        int j = 0;
        printf("%d\n",res1+res2);
        for(int i=0 ; i<res1 ; i++){
            for( j=i*a ; j<(i+1)*a ; j++){
                printf("%c",s[j]);
            }
            printf("\n");
        }

        for(int i=0 ; i<res2 ; i++){
            for(int k=i*b + j ; k<(i+1)*b + j ; k++){
                printf("%c",s[k]);
            }
            printf("\n");
        }

    }
    else{
        printf("-1");
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a,b,na,nb;
bool f(int n){
    if(n==0){
        return true;
    }
    bool s = false;
    if(n-a >= 0){
        na++;
        s = f(n-a);
        if(!s)
            na--;
    }
    if(!s && n-b >=0){
        nb++;
        s = f(n-b);
        if(!s) nb--;
    }
    return s;
}
int main(){
    int n;
    string s;
    cin>>n>>a>>b>>s;
    if(n%b == 0){
        cout<<n/b<<endl;
        for(int i=0 ; i<n/b ; i++){
            string s1 = s.substr(i,i+b);
            cout<<s1<<endl;
        }
    }
    else if(n%a == 0){
         cout<<n/a<<endl;
        for(int i=0 ; i<n/a ; i++){
            string s1 = s.substr(i,i+a);
            cout<<s1<<endl;
        }
    }
    else{
        if(f(n)){
            cout<<an+ab<<endl;
            int j=0;
            string s1;
            for(j=0 ; j<na ; j++){
                s1 = s.substr(j,j+a);
                cout<<s1<<endl;
            }
            for( ; j<nb ; j++){
                s1 = s.substr(j,j+b);
                cout<<s1<<endl;
            }

        }
else
cout<<-1;
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define fr first
#define sc second
using namespace std;

int m,l,n,q,p;
bool v[110];
bool f(int s){
    if(s == 0)return 1;
    if(s < 0)return 0;
    if(s%p == 0){
        m+= s/p;
        return true;
    }
    if(s%q == 0){
        l+= s/q;
        return true;
    }
    if(v[s]) return 0;
    v[s] = 1;
    m++;
    bool t = f(s-p);
    if(!t){
        m--;
        l++;
        t = f(s-q);
        if(!t) l--;
    }
    return t;
}

int main(){
    cin>>n>>p>>q;
    string s;
    cin>>s;
    if(f(n)){
        cout<<m+l<<endl;
        int j=0;
        for(int i=0 ; i<m  ;i++){
            for(int k=0 ; k<p ; k++){
                printf("%c",s[j++]);
            }
            cout<<endl;
        }
        for(int i=0 ; i<l  ;i++){
            for(int k=0 ; k<q ; k++){
                printf("%c",s[j++]);
            }
            cout<<endl;
        }
    }
    else{
        cout<<-1;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a,b,na,nb;
bool f(int n){
    if(n==0){
        return true;
    }
    bool s = false;
    if(n-a >= 0){
        na++;
        s = f(n-a);
        if(!s)
            na--;
    }
    if(!s && n-b >=0){
        nb++;
        s = f(n-b);
        if(!s) nb--;
    }
    return s;
}
int main(){
    int n;
    string s;
    cin>>n>>a>>b>>s;
    if(n%b == 0){
        cout<<n/b<<endl;
        for(int i=0 ; i<n/b ; i++){
            string s1 = s.substr(i*b,i*b+b);
            cout<<s1<<endl;
        }
    }
    else if(n%a == 0){
         cout<<n/a<<endl;
        for(int i=0 ; i<n/a ; i++){
            string s1 = s.substr(i*a,i*a+a);
            cout<<s1<<endl;
        }
    }
    else{
        if(f(n)){
            cout<<na+nb<<endl;
            int j=0;
            string s1;
            for(j=0 ; j<na ; j++){
                s1 = s.substr(j*a,j*a+a);
                cout<<s1<<endl;
            }
int z = j*a;
            for(int j1=0 ; j1<nb ; j1++){
                s1 = s.substr(z+j*b,z+j*b+b);
                cout<<s1<<endl;
            }

        }
else
cout<<-1;
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define fr first
#define sc second
using namespace std;

int m,l,n,q,p;

bool f(int s){
    if(s == 0)return 1;
    if(s < 0)return 0;
    if(s%p == 0){
        m+= s/p;
        return true;
    }
    if(s%q == 0){
        l+= s/q;
        return true;
    }
    m++;
    bool t = f(s-p);
    if(!t){
        m--;
        l++;
        t = f(s-q);
        if(!t) l--;
    }
    return t;
}

int main(){
    cin>>n>>p>>q;
    string s;
    cin>>s;
    if(f(n)){
        cout<<m+l<<endl;
        int j=0;
        for(int i=0 ; i<m  ;i++){
            for(int k=0 ; k<p ; k++){
                printf("%c",s[j++]);
            }
            cout<<endl;
        }
        for(int i=0 ; i<l  ;i++){
            for(int k=0 ; k<q ; k++){
                printf("%c",s[j++]);
            }
            cout<<endl;
        }
    }
    else{
        cout<<-1;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a,b,na,nb;
bool f(int n){
    if(n==0){
        return true;
    }
    bool s = false;
    if(n-a >= 0){
        na++;
        s = f(n-a);
        if(!s)
            na--;
    }
    if(!s && n-b >=0){
        nb++;
        s = f(n-b);
        if(!s) nb--;
    }
    return s;
}
int main(){
    int n;
    string s;
    cin>>n>>a>>b>>s;
    if(n%b == 0){
        cout<<n/b<<endl;
        for(int i=0 ; i<n/b ; i++){
            string s1 = s.substr(i*b,i*b+b);
            cout<<s1<<endl;
        }
    }
    else if(n%a == 0){
         cout<<n/a<<endl;
        for(int i=0 ; i<n/a ; i++){
            string s1 = s.substr(i*a,i*a+a);
            cout<<s1<<endl;
        }
    }
    else{
        if(f(n)){
            cout<<na+nb<<endl;
            int j=0;
            string s1;
            for(j=0 ; j<na ; j++){
                s1 = s.substr(j*a,j*a+a);
                cout<<s1<<endl;
            }
            for( ; j<nb+na ; j++){
                s1 = s.substr(j*b,j*b+b);
                cout<<s1<<endl;
            }

        }
else
cout<<-1;
    }
    return 0;
}


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

const double EPS = 1e-9;
long long gcd(long long a, long long b)
{
    return b == 0 ? a : gcd(b, a % b);
}

template <typename t1> t1 gcd(t1 a, t1 b) { return b == 0 ? a : gcd(b, a % b); }
template <typename t1> t1 lcm(t1 a, t1 b) { return a * (b / gcd(a, b)); }

#define     ll      long long
#define     pii     pair<int,int>
#define     p_b     push_back
#define     m_p     make_pair
#define     p_q     priority_queue

vector <string> vec;

int main()
{
    int n,p,q;
    while(cin>>n>>p>>q)
    {
        getchar();
        char s[200];
        gets(s);
        int x,y=0;
        int flag=0;
        while((n-q*y)>=0)
        {
            if((n-q*y)%p==0)
            {
                x=(n-q*y)/p;
                flag=1;
                break;
            }

            y++;
        }

        if(flag==0) cout<<-1<<endl;
        else
        {
            cout<<x+y<<endl;

            int ind=0;

            for(int i=0;i<x;i++)
            {
                for(int j=0;j<p;j++) cout<<s[ind++];
                cout<<endl;
            }

            for(int i=0;i<y;i++)
            {
                for(int j=0;j<q;j++) cout<<s[ind++];
                cout<<endl;
            }
        }
    }
}


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

const double EPS = 1e-9;
long long gcd(long long a, long long b)
{
    return b == 0 ? a : gcd(b, a % b);
}

template <typename t1> t1 gcd(t1 a, t1 b) { return b == 0 ? a : gcd(b, a % b); }
template <typename t1> t1 lcm(t1 a, t1 b) { return a * (b / gcd(a, b)); }

#define     ll      long long
#define     pii     pair<int,int>
#define     p_b     push_back
#define     m_p     make_pair
#define     p_q     priority_queue

vector <string> vec;

int main()
{
    int n,p,q;
    while(cin>>n>>p>>q)
    {
        getchar();
        char s[200];
        gets(s);
        int x,y=0;
        int flag=0;
        while((n-q*y)>=0)
        {
            if((n-q*y)%p==0)
            {
                x=(n-q*y)/p;
                flag=1;
                break;
            }

            y++;
        }

        if(flag==0) cout<<"Impossible"<<endl;
        else
        {
            cout<<x+y<<endl;

            int ind=0;

            for(int i=0;i<x;i++)
            {
                for(int j=0;j<p;j++) cout<<s[ind++];
                cout<<endl;
            }

            for(int i=0;i<y;i++)
            {
                for(int j=0;j<q;j++) cout<<s[ind++];
                cout<<endl;
            }
        }
    }
}


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

const double EPS = 1e-9;
long long gcd(long long a, long long b)
{
    return b == 0 ? a : gcd(b, a % b);
}

template <typename t1> t1 gcd(t1 a, t1 b) { return b == 0 ? a : gcd(b, a % b); }
template <typename t1> t1 lcm(t1 a, t1 b) { return a * (b / gcd(a, b)); }

#define     ll      long long
#define     pii     pair<int,int>
#define     p_b     push_back
#define     m_p     make_pair
#define     p_q     priority_queue

int main()
{
    int n,p,q;
    while(cin>>n>>p>>q)
    {
        getchar();
        char s[200];
        gets(s);
       // puts(s);
        if(n%(p+q)==0 && p!=q)
        {
            int nn=n/(p+q);
            cout<<2*nn<<endl;
            int ind=0;
            for(int ii=0;ii<nn;ii++)
            {
                for(int i=0;i<p;i++) cout<<s[ind++];
                cout<<endl;
                for(int i=0;i<q;i++) cout<<s[ind++];
                cout<<endl;

                //cout<<"        "<<ii<<endl;
            }

        }

        else if(n%p==0)
        {
            int nn = n/p;
            cout<<nn<<endl;
            for(int i=0;i<n;i++)
            {
                cout<<s[i];
                if((i+1)%p==0) cout<<endl;
            }
        }

        else if(n%q==0)
        {
            int nn = n/q;
            cout<<nn<<endl;
            for(int i=0;i<n;i++)
            {
                cout<<s[i];
                if((i+1)%q==0) cout<<endl;
            }
        }

        else
        {
            cout<<-1<<endl;
        }
    }
}


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

const double EPS = 1e-9;
long long gcd(long long a, long long b)
{
    return b == 0 ? a : gcd(b, a % b);
}

template <typename t1> t1 gcd(t1 a, t1 b) { return b == 0 ? a : gcd(b, a % b); }
template <typename t1> t1 lcm(t1 a, t1 b) { return a * (b / gcd(a, b)); }

#define     ll      long long
#define     pii     pair<int,int>
#define     p_b     push_back
#define     m_p     make_pair
#define     p_q     priority_queue

vector <string> vec;

int main()
{
    int n,p,q;
    while(cin>>n>>p>>q)
    {
        getchar();
        char s[200];
        gets(s);
       // puts(s);
       if(n%(p+q)==0 && p!=q)
        {
            int nn=n/(p+q);
            cout<<2*nn<<endl;
            int ind=0;
            for(int ii=0;ii<nn;ii++)
            {
                for(int i=0;i<p;i++) cout<<s[ind++];
                cout<<endl;
                for(int i=0;i<q;i++) cout<<s[ind++];
                cout<<endl;

                //cout<<"        "<<ii<<endl;
            }

        }
       else  if(n%p==0)
        {
            int nn = n/p;
            cout<<nn<<endl;
            for(int i=0;i<n;i++)
            {
                cout<<s[i];
                if((i+1)%p==0) cout<<endl;
            }
        }

        else if(n%q==0)
        {
            int nn = n/q;
            cout<<nn<<endl;
            for(int i=0;i<n;i++)
            {
                cout<<s[i];
                if((i+1)%q==0) cout<<endl;
            }
        }

        else
        {

            int len=0;
            int ind=0;
            while(len+p<=n)
            {
                string x="";
                len+=p;
                for(int i=0;i<p;i++)
                {
                    x+=s[ind++];

                }
                vec.p_b(x);

            }

            while(len+q<=n)
            {
                string x="";
                len+=q;
                for(int i=0;i<q;i++)
                {
                    x+=s[ind++];

                }
                vec.p_b(x);
            }

            if(len==n)
            {
                cout<<vec.size()<<endl;
                for(int i=0;i<vec.size();i++)
                {
                    cout<<vec[i]<<endl;
                }
            }
            else
            {
                vec.clear();

                len=0;
                ind=0;

                while(len+q<=n)
                {
                    string x="";
                    len+=q;
                    for(int i=0;i<q;i++)
                    {
                        x+=s[ind++];

                    }
                    vec.p_b(x);
                }
                while(len+p<=n)
                {
                    string x="";
                    len+=p;
                    for(int i=0;i<p;i++)
                    {
                        x+=s[ind++];

                    }
                    vec.p_b(x);

                }

                if(len==n)
                {
                    cout<<vec.size()<<endl;
                    for(int i=0;i<vec.size();i++)
                    {
                        cout<<vec[i]<<endl;
                    }
                }

                else
                    cout<<-1<<endl;
            }
        }
    }
}


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

const double EPS = 1e-9;
long long gcd(long long a, long long b)
{
    return b == 0 ? a : gcd(b, a % b);
}

template <typename t1> t1 gcd(t1 a, t1 b) { return b == 0 ? a : gcd(b, a % b); }
template <typename t1> t1 lcm(t1 a, t1 b) { return a * (b / gcd(a, b)); }

#define     ll      long long
#define     pii     pair<int,int>
#define     p_b     push_back
#define     m_p     make_pair
#define     p_q     priority_queue

vector <string> vec;

int main()
{
    int n,p,q;
    while(cin>>n>>p>>q)
    {
        getchar();
        char s[200];
        gets(s);
       // puts(s);
        if(n%p==0)
        {
            int nn = n/p;
            cout<<nn<<endl;
            for(int i=0;i<n;i++)
            {
                cout<<s[i];
                if((i+1)%p==0) cout<<endl;
            }
        }

        else if(n%q==0)
        {
            int nn = n/q;
            cout<<nn<<endl;
            for(int i=0;i<n;i++)
            {
                cout<<s[i];
                if((i+1)%q==0) cout<<endl;
            }
        }

        else
        {

            int len=0;
            int ind=0;
            while(len+p<=n)
            {
                string x="";
                len+=p;
                for(int i=0;i<p;i++)
                {
                    x+=s[ind++];

                }
                vec.p_b(x);

            }

            while(len+q<=n)
            {
                string x="";
                len+=q;
                for(int i=0;i<q;i++)
                {
                    x+=s[ind++];

                }
                vec.p_b(x);
            }

            if(len==n)
            {
                cout<<vec.size()<<endl;
                for(int i=0;i<vec.size();i++)
                {
                    cout<<vec[i]<<endl;
                }
            }
            else
            {
                cout<<-1<<endl;
            }
        }
    }
}


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

const double EPS = 1e-9;
long long gcd(long long a, long long b)
{
    return b == 0 ? a : gcd(b, a % b);
}

template <typename t1> t1 gcd(t1 a, t1 b) { return b == 0 ? a : gcd(b, a % b); }
template <typename t1> t1 lcm(t1 a, t1 b) { return a * (b / gcd(a, b)); }

#define     ll      long long
#define     pii     pair<int,int>
#define     p_b     push_back
#define     m_p     make_pair
#define     p_q     priority_queue

vector <string> vec;

int main()
{
    int n,p,q;
    while(cin>>n>>p>>q)
    {
        getchar();
        char s[200];
        gets(s);
       // puts(s);
       if(n%(p+q)==0 && p!=q)
        {
            int nn=n/(p+q);
            cout<<2*nn<<endl;
            int ind=0;
            for(int ii=0;ii<nn;ii++)
            {
                for(int i=0;i<p;i++) cout<<s[ind++];
                cout<<endl;
                for(int i=0;i<q;i++) cout<<s[ind++];
                cout<<endl;

                //cout<<"        "<<ii<<endl;
            }

        }
       else  if(n%p==0)
        {
            int nn = n/p;
            cout<<nn<<endl;
            for(int i=0;i<n;i++)
            {
                cout<<s[i];
                if((i+1)%p==0) cout<<endl;
            }
        }

        else if(n%q==0)
        {
            int nn = n/q;
            cout<<nn<<endl;
            for(int i=0;i<n;i++)
            {
                cout<<s[i];
                if((i+1)%q==0) cout<<endl;
            }
        }

        else
        {

            int len=0;
            int ind=0;
            while(len+p<=n)
            {
                string x="";
                len+=p;
                for(int i=0;i<p;i++)
                {
                    x+=s[ind++];

                }
                vec.p_b(x);

            }

            while(len+q<=n)
            {
                string x="";
                len+=q;
                for(int i=0;i<q;i++)
                {
                    x+=s[ind++];

                }
                vec.p_b(x);
            }

            if(len==n)
            {
                cout<<vec.size()<<endl;
                for(int i=0;i<vec.size();i++)
                {
                    cout<<vec[i]<<endl;
                }
            }
            else
            {
                cout<<-1<<endl;
            }
        }
    }
}


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

int main()
{
    int n,p,q;
    cin>>n>>p>>q;
    string s;
    cin>>s;
    int beg;
    if(n%p == 0){
        int k= n/p;
        cout<<k<<endl;

        beg = 0;
        for(int i = 1; i <= k;i++)
        {
            for(int j = beg; j < beg + p; j++)
            {
                cout<<s[j];
            }
            cout<<endl;
            beg+=p;
        }
    }
    else if(n%q == 0)
    {
        int k= n/q;
        cout<<k<<endl;

        beg = 0;
        for(int i = 1; i <= k;i++)
        {
            for(int j = beg; j < beg + q; j++)
            {
                cout<<s[j];
            }
            cout<<endl;
            beg+=q;
        }
    }
    else if(n % (p+q) == 0)
    {
        int k = 2*n/(p+q);
        cout<<k<<endl;

        beg = 0;
        for(int i = 1; i <= k/2; i++)
        {
            for(int j = beg; j < beg + p; j++)
            {
                cout<<s[j];
            }
            cout<<endl;
            beg+=p;
            for(int j = beg; j < beg + q; j++)
            {
                cout<<s[j];
            }
            cout<<endl;
            beg+=q;
        }
    }
    else cout<<"-1\n";
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int,int> vi;
typedef pair<int,int> pii;
typedef vector<long long,long long> vl;
typedef pair<long long,long long> pll;

int main()
{
    int i,j,n,p,q,key,k,noans=-1;
    string s;
    cin>>n>>p>>q;
    cin>>s;
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<=n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<i+j<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }
            }
        }
        else
        {
            cout<<noans;
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int,int> vi;
typedef pair<int,int> pii;
typedef vector<long long,long long> vl;
typedef pair<long long,long long> pll;

int main()
{
    int i,j,n,p,q,key,k,noans=-1;
    string s;
    cin>>n>>p>>q;
    cin>>s;
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<=n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<i+j<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }
            }
            if(key==0)
                cout<<noans;
        }
        else
        {
            cout<<noans;
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int,int> vi;
typedef pair<int,int> pii;
typedef vector<long long,long long> vl;
typedef pair<long long,long long> pll;

int main()
{
    int i,j,n,p,q,key,k;
    string s;
    cin>>n>>p>>q;
    cin>>s;
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<=n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;( (i*p)+(j*q)<=n )&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<i+j<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }
            }
        }
        else
        {
            cout<<"-1";
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

int main()
{
    long long i,j,n,p,q,key,k,noans=-1;
    string s;
    cin>>n>>p>>q;
    cin>>s;
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<=n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<(i+j)<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }

                if(!key)
                {
                    cout<<noans;
                }
            }
        }
        else
        {
            cout<<noans;
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int,int> vi;
typedef pair<int,int> pii;
typedef vector<long long,long long> vl;
typedef pair<long long,long long> pll;

int main()
{
    int i,j,n,p,q,key,k;
    string s;
    cin>>n>>p>>q;
    cin>>s;
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<=n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<i+j<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }
            }
        }
        else
        {
            cout<<"-1";
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

int main()
{
    long long i,j,n,p,q,key,k,noans=-1;
    char s[101];
    cin>>n>>p>>q;
    for(i=0;i<n;i++)
    {
        cin>>s[i];
    }
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<=n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<(i+j)<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }

                if(!key)
                {
                    cout<<noans;
                }
            }
        }
        else
        {
            cout<<noans;
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int,int> vi;
typedef pair<int,int> pii;
typedef vector<long long,long long> vl;
typedef pair<long long,long long> pll;

int main()
{
    int i,j,n,p,q,key,k,noans=-1;
    char s[101];
    cin>>n>>p>>q;
    for(i=0;i<n;i++)
    {
        cin>>s[i];
    }
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<=n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<i+j<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }

                if(!key)
                {
                    cout<<noans;
                }
            }
        }
        else
        {
            cout<<noans;
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int,int> vi;
typedef pair<int,int> pii;
typedef vector<long long,long long> vl;
typedef pair<long long,long long> pll;

int main()
{
    int i,j,n,p,q,key,k,noans=-1;
    string s;
    cin>>n>>p>>q;
    cin>>s;
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<i+j<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }
            }
        }
        else
        {
            cout<<noans;
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int,int> vi;
typedef pair<int,int> pii;
typedef vector<long long,long long> vl;
typedef pair<long long,long long> pll;

int main()
{
    int i,j,n,p,q,key,k,noans=-1;
    string s;
    cin>>n>>p>>q;
    cin>>s;
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p<n||q<n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<i+j<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }
            }
        }
        else
        {
            cout<<noans;
        }
    }

    return 0;
}


//pra$anna
//code for Text splitting on CF edu round #4
//

#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
#include<cstdio>
#include<cmath>
#include<bitset>
#include<sstream>
using namespace std;

#define pb(n) push_back(n)
#define mod 1000000007
#define fab(i,a,b) for(int i=a;i<=b;i++)
#define f(i,n) for(i=0;i<n;i++)
#define min(x,y) ((x<y)?(x):(y))
#define max(x,y) ((x>y)?(x):(y))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int,int> vi;
typedef pair<int,int> pii;
typedef vector<long long,long long> vl;
typedef pair<long long,long long> pll;

int main()
{
    int i,j,n,p,q,key,k,noans=-1;
    char s[101];
    cin>>n>>p>>q;
    for(i=0;i<n;i++)
    {
        cin>>s[i];
    }
    if(n%p==0)
    {
        cout<<n/p<<endl;
        f(i,n)
        {
            if(i%p==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else if(n%q==0)
    {
        cout<<n/q<<endl;
        f(i,n)
        {
            if(i%q==0&&i!=0)
                cout<<endl;

            cout<<s[i];
        }
    }
    else
    {
        if(p+q<=n)
        {
            key=0;
            for(i=1;i<=100&&!key;i++)
            {
                for(j=1;j<=100&&!key;j++)
                {
                    if((i*p)+(j*q)==n)
                    {
                        key=1;
                        //cout<<"i="<<i<<" "<<"j="<<j<<endl;
                        cout<<i+j<<endl;
                        for(k=0;k<i*p;k++)
                        {

                            if(k%p==0&&k!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                        if(k==i*p&&k!=0)
                        {
                            cout<<endl;
                        }

                        for(i=0;k<n;k++,i++)
                        {
                            if(i%q==0&&i!=0)
                                cout<<endl;

                            cout<<s[k];
                        }
                    }
                }
            }
        }
        else
        {
            cout<<noans;
        }
    }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
int main()
{
	int n, a, b, i, j;
	S s;
	cin >> n >> a >> b;
	cin >> s;
	if (n%a == 0)
	{
		cout << n / a << endl;
		for (i = 0;i < n;i += a)cout << s.substr(i, a) << endl;
	}
	else if (n%b == 0)
	{
		cout << n / b << endl;
		for (i = 0;i < n;i += b)cout << s.substr(i, b) << endl;
	}
	else if (n%(a+b) == a)
	{
		int z = (n / (a + b));
		cout << ( (z*2) + 1) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
		cout << s.substr(i, a)<<endl;
	}
	else if (n % (a + b) == b)
	{
		int z = (n / (a + b));
		cout << ((z * 2) + 1) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
		cout << s.substr(i, b)<<endl;
	}
	else if (n % (a + b) == 0)
	{
		int z = (n / (a + b));
		cout << (z * 2) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
	}
	else cout << -1 << endl;

	//system("pause");
	return 0;

}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
map <char, ll > m;
bool open(char w) { if (w == '{' || w == '(' || w == '[' || w == '<')return true;else return false; }
char d(char w)
{
	if (w == '}')return '{';
	if (w == ')')return '(';
	if (w == '>')return '<';
	if (w == ']')return '[';
}
int main()
{
	/*ll n, i, j,a,ans=0,oo=0,cc=0,an=0;
	S s;
	cin >> s;
	if (s.length() % 2 != 0) { cout << "Impossible" << endl;return 0; }
	for (i = 0;i < s.length();i++)
	{
		if (open(s[i]))
		{
			oo++;
			m[s[i]]++;
		}

		else
		{
			cc++;
			if (cc > oo) { cout << "Impossible" << endl;return 0; }
			if (m[d(s[i])])  m[d(s[i])]--;
			else an++;
		}
	}
	if (oo != cc) { cout << "Impossible" << endl;return 0; }
	cout <<an<< endl;*/

	//////////////////

	int n, a, b, i, j,aa=0,bb=0,z,x,y;
	bool t = 0;
	S s;
	cin >> n >> z >> x;
	cin >> s;
	a = min(z, x);
	b = max(z, x);
	y = b - a;
	aa = n/a;
	while (((aa*a)+(bb*b))!=n)
	{
		if ((n - (aa*a)) % y == 0 && ((n - (aa*a)) / y) <= aa)
		{
			bb = ((n - (aa*a)) / y);
			aa -= ((n - (aa*a)) / y);
			break;
		}
		if (aa == 0) { cout << -1 << endl;return 0; }
		aa--;
	}
	{
		cout << aa + bb << endl;
		for (i = 0;i < (aa*a);i += a)cout << s.substr(i, a) << endl;
		for (;i < s.length();i += b)cout << s.substr(i, b) << endl;
	}
	//system("pause");
	return 0;

}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
map <char, ll > m;
bool open(char w) { if (w == '{' || w == '(' || w == '[' || w == '<')return true;else return false; }
char d(char w)
{
	if (w == '}')return '{';
	if (w == ')')return '(';
	if (w == '>')return '<';
	if (w == ']')return '[';
}
int main()
{
	/*ll n, i, j,a,ans=0,oo=0,cc=0,an=0;
	S s;
	cin >> s;
	if (s.length() % 2 != 0) { cout << "Impossible" << endl;return 0; }
	for (i = 0;i < s.length();i++)
	{
		if (open(s[i]))
		{
			oo++;
			m[s[i]]++;
		}

		else
		{
			cc++;
			if (cc > oo) { cout << "Impossible" << endl;return 0; }
			if (m[d(s[i])])  m[d(s[i])]--;
			else an++;
		}
	}
	if (oo != cc) { cout << "Impossible" << endl;return 0; }
	cout <<an<< endl;*/

	//////////////////

	int n, a, b, i, j,aa=0,bb=0;
	bool t = 0;
	S s;
	cin >> n >> a >> b;
	cin >> s;
	if (n%a == 0)
	{
		t = 1;
		aa = n / a;
	}
	else if (n%b == 0)
	{
		t = 1;
		bb = n / b;
	}
	else if ((n%(a+b))%a == 0)
	{
		t = 1;
		aa += ( n / (a + b));
		bb += (n / (a + b));
		aa += ((n % (a + b)) / a);
	}
	else if ((n % (a + b))%b == 0)
	{
		t = 1;
		aa += (n / (a + b));
		bb += (n / (a + b));
		bb += ((n % (a + b)) / b);
	}
	else if (n % (a + b) == 0)
	{
		t = 1;
		aa += (n / (a + b));
		bb += (n / (a + b));
	}
	else if ((n%a) % b == 0)
	{
		t = 1;
		aa += n / a;
		bb += ((n%a) / b);
	}
	else if ((n%b) % a == 0)
	{
		t = 1;
		bb += n / b;
		aa += ((n%b) / a);
	}
	if (t)
	{
		cout << aa + bb << endl;
		for (i = 0;i < (aa*a);i += a)cout << s.substr(i, a)<<endl;
		for (;i < s.length();i += b)cout << s.substr(i, b)<<endl;
	}
	else cout << -1 << endl;

	//system("pause");
	return 0;

}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
map <char, ll > m;
bool open(char w) { if (w == '{' || w == '(' || w == '[' || w == '<')return true;else return false; }
char d(char w)
{
	if (w == '}')return '{';
	if (w == ')')return '(';
	if (w == '>')return '<';
	if (w == ']')return '[';
}
int main()
{
	/*ll n, i, j,a,ans=0,oo=0,cc=0,an=0;
	S s;
	cin >> s;
	if (s.length() % 2 != 0) { cout << "Impossible" << endl;return 0; }
	for (i = 0;i < s.length();i++)
	{
		if (open(s[i]))
		{
			oo++;
			m[s[i]]++;
		}

		else
		{
			cc++;
			if (cc > oo) { cout << "Impossible" << endl;return 0; }
			if (m[d(s[i])])  m[d(s[i])]--;
			else an++;
		}
	}
	if (oo != cc) { cout << "Impossible" << endl;return 0; }
	cout <<an<< endl;*/

	//////////////////

	int n, a, b, i, j;
	S s;
	cin >> n >> a >> b;
	cin >> s;
	if (n%a == 0)
	{
		cout << n / a << endl;
		for (i = 0;i < n;i += a)cout << s.substr(i, a) << endl;
	}
	else if (n%b == 0)
	{
		cout << n / b << endl;
		for (i = 0;i < n;i += b)cout << s.substr(i, b) << endl;
	}
	else if ((n%(a+b))%a == 0)
	{
		int z = (n / (a + b));
		cout << ( (z*2) + ((n % (a + b)) / a)) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
		for (;i < s.length();i += a)cout << s.substr(i, a) << endl;
	}
	else if ((n % (a + b))%b == 0)
	{
		int z = (n / (a + b));
		cout << ((z * 2) + ((n % (a + b)) / b)) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
		for (;i < s.length();i += a)cout << s.substr(i, b) << endl;

	}
	else if (n % (a + b) == 0)
	{
		int z = (n / (a + b));
		cout << (z * 2) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
	}
	else cout << -1 << endl;

	//system("pause");
	return 0;

}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
int main()
{
	int n, a, b, i, j;
	S s;
	cin >> n >> a >> b;
	cin >> s;
	if (n%a == 0)
	{
		cout << n / a << endl;
		for (i = 0;i < n;i += a)cout << s.substr(i, a) << endl;
	}
	else if (n%b == 0)
	{
		cout << n / b << endl;
		for (i = 0;i < n;i += b)cout << s.substr(i, b) << endl;
	}
	else if (n%(a+b) == a)
	{
		int z = (n / (a + b));
		cout << ( (z*2) + 1) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
		cout << s.substr(i, a);
	}
	else if (n % (a + b) == b)
	{
		int z = (n / (a + b));
		cout << ((z * 2) + 1) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
		cout << s.substr(i, b);
	}
	else if (n % (a + b) == 0)
	{
		int z = (n / (a + b));
		cout << (z * 2) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
	}
	else cout << -1 << endl;

	//system("pause");
	return 0;

}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
map <char, ll > m;
bool open(char w) { if (w == '{' || w == '(' || w == '[' || w == '<')return true;else return false; }
char d(char w)
{
	if (w == '}')return '{';
	if (w == ')')return '(';
	if (w == '>')return '<';
	if (w == ']')return '[';
}
int main()
{
	/*ll n, i, j,a,ans=0,oo=0,cc=0,an=0;
	S s;
	cin >> s;
	if (s.length() % 2 != 0) { cout << "Impossible" << endl;return 0; }
	for (i = 0;i < s.length();i++)
	{
		if (open(s[i]))
		{
			oo++;
			m[s[i]]++;
		}

		else
		{
			cc++;
			if (cc > oo) { cout << "Impossible" << endl;return 0; }
			if (m[d(s[i])])  m[d(s[i])]--;
			else an++;
		}
	}
	if (oo != cc) { cout << "Impossible" << endl;return 0; }
	cout <<an<< endl;*/

	int n, a, b, i, j;
	S s;
	cin >> n >> a >> b;
	cin >> s;
	if (n%a == 0)
	{
		cout << n / a << endl;
		for (i = 0;i < n;i += a)cout << s.substr(i, a) << endl;
	}
	else if (n%b == 0)
	{
		cout << n / b << endl;
		for (i = 0;i < n;i += b)cout << s.substr(i, b) << endl;
	}
	else if (n%(a+b) == a)
	{
		int z = (n / (a + b));
		cout << ( (z*2) + 1) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
		cout << s.substr(i, a)<<endl;
	}
	else if (n % (a + b) == b)
	{
		int z = (n / (a + b));
		cout << ((z * 2) + 1) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
		cout << s.substr(i, b)<<endl;
	}
	else if (n % (a + b) == 0)
	{
		int z = (n / (a + b));
		cout << (z * 2) << endl;
		for (i = 0;i < (z *(a + b));i += (a + b))
		{
			cout << s.substr(i, a) << endl << s.substr(i + a, b) << endl;
		}
	}
	else if (n%a == b)
	{
		cout << (n / a) + 1 << endl;
		for (i = 0;i < (n / a)*a;i += a)cout << s.substr(i, a);
		cout << s.substr(i, b);
	}
	else if (n%b == a)
	{
		cout << (n / b) + 1 << endl;
		for (i = 0;i < (n / b)*b;i += b)cout << s.substr(i, b);
		cout << s.substr(i, a);
	}
	else cout << -1 << endl;

	//system("pause");
	return 0;

}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
map <char, ll > m;
bool open(char w) { if (w == '{' || w == '(' || w == '[' || w == '<')return true;else return false; }
char d(char w)
{
	if (w == '}')return '{';
	if (w == ')')return '(';
	if (w == '>')return '<';
	if (w == ']')return '[';
}
int main()
{
	/*ll n, i, j,a,ans=0,oo=0,cc=0,an=0;
	S s;
	cin >> s;
	if (s.length() % 2 != 0) { cout << "Impossible" << endl;return 0; }
	for (i = 0;i < s.length();i++)
	{
		if (open(s[i]))
		{
			oo++;
			m[s[i]]++;
		}

		else
		{
			cc++;
			if (cc > oo) { cout << "Impossible" << endl;return 0; }
			if (m[d(s[i])])  m[d(s[i])]--;
			else an++;
		}
	}
	if (oo != cc) { cout << "Impossible" << endl;return 0; }
	cout <<an<< endl;*/

	//////////////////

	int n, a, b, i, j,aa=0,bb=0;
	bool t = 0;
	S s;
	cin >> n >> a >> b;
	cin >> s;
	if (n%a == 0)
	{
		t = 1;
		aa = n / a;
	}
	else if (n%b == 0)
	{
		t = 1;
		bb = n / b;
	}
	else if ((n%(a+b))%a == 0)
	{
		t = 1;
		aa += ( n / (a + b));
		bb += (n / (a + b));
		aa += ((n % (a + b)) / a);
	}
	else if ((n % (a + b))%b == 0)
	{
		t = 1;
		aa += (n / (a + b));
		bb += (n / (a + b));
		bb += ((n % (a + b)) / b);
	}
	else if (n % (a + b) == 0)
	{
		t = 1;
		aa += (n / (a + b));
		bb += (n / (a + b));
	}
	if (t)
	{
		cout << aa + bb << endl;
		for (i = 0;i < (aa*a);i += a)cout << s.substr(i, a)<<endl;
		for (;i < s.length();i += b)cout << s.substr(i, b)<<endl;
	}
	else cout << -1 << endl;

	//system("pause");
	return 0;

}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
map <char, ll > m;
bool open(char w) { if (w == '{' || w == '(' || w == '[' || w == '<')return true;else return false; }
char d(char w)
{
	if (w == '}')return '{';
	if (w == ')')return '(';
	if (w == '>')return '<';
	if (w == ']')return '[';
}
int main()
{
	/*ll n, i, j,a,ans=0,oo=0,cc=0,an=0;
	S s;
	cin >> s;
	if (s.length() % 2 != 0) { cout << "Impossible" << endl;return 0; }
	for (i = 0;i < s.length();i++)
	{
		if (open(s[i]))
		{
			oo++;
			m[s[i]]++;
		}

		else
		{
			cc++;
			if (cc > oo) { cout << "Impossible" << endl;return 0; }
			if (m[d(s[i])])  m[d(s[i])]--;
			else an++;
		}
	}
	if (oo != cc) { cout << "Impossible" << endl;return 0; }
	cout <<an<< endl;*/

	//////////////////

	int n, a, b, i, j,aa=0,bb=0,z,x,y;
	bool t = 0;
	S s;
	cin >> n >> z >> x;
	cin >> s;
	a = min(z, x);
	b = max(z, x);
	y = b - a;
	aa = n/a;
	while (((aa*a)+(bb*b))!=n)
	{
		if ((n - (aa*a)) % y == 0 && ((n - (aa*a)) / y) <= aa)
		{
			aa -= ((n - (aa*a)) / y);
			bb = ((n - (aa*a)) / y);
			break;
		}
		if (aa == 0) { cout << -1 << endl;return 0; }
		aa--;
	}
	{
		cout << aa + bb << endl;
		for (i = 0;i < (aa*a);i += a)cout << s.substr(i, a) << endl;
		for (;i < s.length();i += b)cout << s.substr(i, b) << endl;
	}
	//system("pause");
	return 0;

}


#include<iostream>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
#include<map>
using namespace std;
#define ll long long
#define D double
#define LD long double
#define S string
#define m_p make_pair
map <char, ll > m;
bool open(char w) { if (w == '{' || w == '(' || w == '[' || w == '<')return true;else return false; }
char d(char w)
{
	if (w == '}')return '{';
	if (w == ')')return '(';
	if (w == '>')return '<';
	if (w == ']')return '[';
}
int main()
{
	/*ll n, i, j,a,ans=0,oo=0,cc=0,an=0;
	S s;
	cin >> s;
	if (s.length() % 2 != 0) { cout << "Impossible" << endl;return 0; }
	for (i = 0;i < s.length();i++)
	{
		if (open(s[i]))
		{
			oo++;
			m[s[i]]++;
		}

		else
		{
			cc++;
			if (cc > oo) { cout << "Impossible" << endl;return 0; }
			if (m[d(s[i])])  m[d(s[i])]--;
			else an++;
		}
	}
	if (oo != cc) { cout << "Impossible" << endl;return 0; }
	cout <<an<< endl;*/

	//////////////////

	int n, a, b, i, j,aa=0,bb=0,z,x,y;
	bool t = 0;
	S s;
	cin >> n >> z >> x;
	cin >> s;
	a = min(z, x);
	b = max(z, x);
	y = b - a;
	aa = n/a;
	if (y == 0)
	{
		if (n%a!=0) { cout << -1 << endl;return 0; }
		aa = n / a;
	}
	else {
		while (((aa*a) + (bb*b)) != n)
		{
			if ((n - (aa*a)) % y == 0 && ((n - (aa*a)) / y) <= aa)
			{
				bb = ((n - (aa*a)) / y);
				aa -= ((n - (aa*a)) / y);
				break;
			}
			if (aa == 0) { cout << -1 << endl;return 0; }
			aa--;
		}
	}
	{
		cout << aa + bb << endl;
		for (i = 0;i < (aa*a);i += a)cout << s.substr(i, a) << endl;
		for (;i < s.length();i += b)cout << s.substr(i, b) << endl;
	}
	//system("pause");
	return 0;

}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <climits>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;

int n, p, q;
string s, t;

int main() {
	cin >> n >> p >> q >> s;
	if (n % p == 0) {
		cout << n / p << endl;
		for (int i = 0; i < n; i+=p)
			cout << s.substr(i, p) << endl;
	} else if (n % q == 0) {
		cout << n / q << endl;
		for (int i = 0; i < n; i+=q)
			cout << s.substr(i, q) << endl;
	} else {
		bool go = false;
		int cnt = 0, rem_cnt = 0, add = max(p, q), rem = min(p, q);

		for (int i = 0; i < n; cnt++, i+=add) {
			if ((n - i) % rem == 0) {
				rem_cnt += (n - i) / rem;
				go = true;
				break;
			}
		}

		//if (go) {
			int pos = 0;

			cout << cnt + rem_cnt << endl;
			for (int i = 0; i < cnt ; i++, pos+=p)
				cout << s.substr(pos,p) << endl;
			for (; pos < n; pos += q)
				cout << s.substr(pos, q) << endl;
		//} else {
		//	cout << -1 << endl;
		//}
	}
}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <climits>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;

int n, p, q;
string s, t;
vector<string> ans;

int main() {
	cin >> n >> p >> q >> s;
	if (n % p == 0) {
		cout << n / p << endl;
		for (int i = 0; i < n; i+=p)
			cout << s.substr(i, p) << endl;
	} else if (n % q == 0) {
		cout << n / q << endl;
		for (int i = 0; i < n; i+=q)
			cout << s.substr(i, q) << endl;
	} else {
		bool go = false;
		int cnt = 0, rem_cnt = 0, add = max(p, q), rem = min(p, q);

		for (int i = 0; i < n; cnt++, i+=add) {
			if ((n - i) % rem == 0) {
				rem_cnt += (n - i) / rem;
				go = true;
				break;
			}
		}

		if (go) {
			int pos = 0;

			for (int i = 0; i < cnt ; i++, pos+=p)
				ans.pb(s.substr(pos,p));
			for (; pos < n; pos += q)
				ans.pb(s.substr(pos, q));

			cout << ans.size() << endl;
			for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;

		} else {
			cout << -1 << endl;
		}
	}
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;

vector<string> ans;

bool good = true;
int n, p, q;
string s;

int main() {
	cin >> n >> p >> q >> s;

	int x = 0, curr = max(p, q);
	while (x < n) {
		if ((n - x) % min(p, q) == 0)
			curr = min(p, q);
		ans.pb(s.substr(x, curr));
		x += curr;
	}

	for (int i = 0; i < ans.size(); i++)
		if (ans[i].size() != p || ans[i].size() != q)
			good = false;

	if (true) {
		cout << ans.size() << endl;
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
	} else {
		cout << -1 << endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;

vector<string> ans;

bool good = true;
int n, p, q;
string s;

int main() {
	cin >> n >> p >> q >> s;

	int x = 0, curr = max(p, q);
	while (x < n) {
		if ((n - x) % min(p, q) == 0)
			curr = min(p, q);
		ans.pb(s.substr(x, curr));
		x += curr;
	}

	for (int i = 0; i < ans.size(); i++)
		if (ans[i].size() != p && ans[i].size() != q)
			good = false;

	if (good) {
		cout << ans.size() << endl;
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
	} else {
		cout << -1 << endl;
	}
}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <climits>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;

int n, p, q;
string s, t;

int main() {
	cin >> n >> p >> q >> s;
	if (n % p == 0) {
		cout << n / p << endl;
		for (int i = 0; i < n; i+=p)
			cout << s.substr(i, p) << endl;
	} else if (n % q == 0) {
		cout << n / q << endl;
		for (int i = 0; i < n; i+=q)
			cout << s.substr(i, q) << endl;
	} else {
		bool go = false;
		int cnt = 0, rem_cnt = 0, add = max(p, q), rem = min(p, q);

		for (int i = 0; i < n; cnt++, i+=add) {
			if (i + add > n && (n - i) % rem == 0) {
				rem_cnt += (n - i) / rem;
				go = true;
				break;
			}
		}

		if (go) {
			int pos = 0;

			cout << cnt + rem_cnt << endl;
			for (int i = 0; i < cnt ; i++, pos+=p)
				cout << s.substr(pos,p) << endl;
			for (; pos < n; pos += q)
				cout << s.substr(pos, q) << endl;
		} else {
			cout << -1 << endl;
		}
	}
}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <climits>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;

int n, p, q;
string s, t;

int main() {
	cin >> n >> p >> q >> s;
	if (n % p == 0) {
		cout << n / p << endl;
		for (int i = 0; i < n; i+=p)
			cout << s.substr(i, p) << endl;
	} else if (n % q == 0) {
		cout << n / q << endl;
		for (int i = 0; i < n; i+=q)
			cout << s.substr(i, q) << endl;
	} else {
		bool go = false;
		int cnt = 0, rem_cnt = 0, add = max(p, q), rem = min(p, q);

		for (int i = 0; i < n; cnt++, i+=add) {
			if ((n - i) % rem == 0) {
				rem_cnt += (n - i) / rem;
				go = true;
				break;
			}
		}

		if (go) {
			int pos = 0;

			cout << cnt + rem_cnt << endl;
			for (int i = 0; i < cnt ; i++, pos+=p)
				cout << s.substr(pos,p) << endl;
			for (; pos < n; pos += q)
				cout << s.substr(pos, q) << endl;
		} else {
			cout << -1 << endl;
		}
	}
}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <climits>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;

int n, p, q;
string s, t;

int main() {
	cin >> n >> p >> q >> s;
	if (n % p == 0) {
		cout << n / p << endl;
		for (int i = 0; i < n; i+=p)
			cout << s.substr(i, p) << endl;
	} else if (n % q == 0) {
		cout << n / q << endl;
		for (int i = 0; i < n; i+=q)
			cout << s.substr(i, q) << endl;
	} else {
		bool go = false;
		int cnt = 0, add = max(p, q), rem = min(p, q);

		for (int i = 0; i < n; cnt++, i+=add) {
			if (i + add > n && i + rem == n) {
				go = true;
				break;
			}
		}

		if (go) {
			int pos = 0;

			cout << cnt + 1 << endl;
			for (int i = 0; i < cnt; i++, pos+=p)
				cout << s.substr(pos, p) << endl;
			cout << s.substr(n - q, q) << endl;
		} else {
			cout << -1 << endl;
		}
	}
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;

vector<string> ans;

bool good = true;
int n, p, q;
string s;

int main() {
	cin >> n >> p >> q >> s;

	int x = 0, curr = max(p, q);
	while (x < n) {
		if ((n - x) % min(p, q) == 0)
			curr = min(p, q);
		ans.pb(s.substr(x, curr));
		x += curr;
	}

	for (int i = 0; i < ans.size(); i++)
		if (ans[i].size() != p || ans[i].size() != q)
			good = false;

	if (good) {
		cout << ans.size() << endl;
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
	} else {
		cout << -1 << endl;
	}
}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <climits>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;

int n, p, q;
string s, t;

int main() {
	cin >> n >> p >> q >> s;
	if (n % p == 0) {
		cout << n / p << endl;
		for (int i = 0; i < n; i+=p)
			cout << s.substr(i, p) << endl;
	} else if (n % q == 0) {
		cout << n / q << endl;
		for (int i = 0; i < n; i+=q)
			cout << s.substr(i, q) << endl;
	} else {
		bool go = false;
		int cnt = 0, add = max(p, q), rem = min(p, q);

		for (int i = 0; i < n; cnt++, i+=add) {
			if (i + add > n && n - i % rem) {
				go = true;
				break;
			}
		}

		if (go) {
			int pos = 0;

			cout << cnt + 1 << endl;
			for (int i = 0; i < cnt; i++, pos+=p)
				cout << s.substr(pos, p) << endl;
			for (; pos < n; pos += q)
				cout << s.substr(pos, q) << endl;
		} else {
			cout << -1 << endl;
		}
	}
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,p,q,i,j,k,l;
    string s;
    cin>>n>>p>>q>>s;

    for(i=0;i<=n;i++)
    {
        if((n-i*p)%q==0)
            break;
    }
    if(i>n || n-i*p<0)
    {
        cout<<-1;
        return 0;
    }
    cout<<i+(n-i)/q<<endl;
    l=0;
    for(j=0;j<i;j++)
    {
        for(k=0;k<p;k++)
            cout<<s[l++];
        cout<<endl;
    }
    for(;l<n;)
    {
        for(k=0;k<q;k++)
            cout<<s[l++];
        cout<<endl;
    }

    return 0;
}