#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a < b) return gcd(b, a);
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int main(void) {
  int n, p, q;
  cin >> n >> p >> q;
  string s;
  cin >> s;
  if (p == 1 || q == 1) {
    cout << n << endl;
    for (int i = 0; i < s.size(); i++) cout << s[i] << endl;
  } else {
    int result = 0;
    int temp = n;
    while (temp % q != 0 && temp > 0) {
      temp -= p;
      result++;
    }
    if (temp < 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << result + temp / q << endl;
    for (int i = 0; i < result; i++) {
      for (int j = 0; j < p; j++) cout << s[i * p + j];
      cout << endl;
    }
    for (int i = 0; i < temp / q; i++) {
      for (int j = 0; j < q; j++) cout << s[result * p + i * q + j];
      cout << endl;
    }
  }
  return 0;
}
