#include <bits/stdc++.h>
using namespace std;
int n, p, q, temp, pos = 0;
string s;
int main() {
  scanf("%d%d%d", &n, &p, &q);
  cin >> s;
  temp = 0;
  while (temp <= n) {
    if ((n - temp) % q == 0) {
      printf("%d\n", temp / p + (n - temp) / q);
      for (int i = 0; i < temp / p; i++) {
        for (int j = 0; j < p; j++) {
          printf("%c", s[pos]);
          pos++;
        }
        printf("\n");
      }
      for (int i = 0; i < (n - temp) / q; i++) {
        for (int j = 0; j < q; j++) {
          printf("%c", s[pos]);
          pos++;
        }
        printf("\n");
      }
      return 0;
    }
    temp += p;
  }
  printf("-1\n");
  return 0;
}
