#include <bits/stdc++.h>
const int MAXN = 100;
char s[MAXN + 5];
int main() {
  int n, p, q;
  scanf("%d%d%d", &n, &p, &q);
  scanf("%s", s);
  for (int i = 0; p * i <= n; i++) {
    if ((n - p * i) % q == 0) {
      int j = (n - p * i) / q;
      printf("%d\n", i + j);
      int pos = 0;
      for (int k = 1; k <= i; k++) {
        for (int l = 1; l <= p; l++) {
          printf("%c", s[pos]);
          pos++;
        }
        puts("");
      }
      for (int k = 1; k <= j; k++) {
        for (int l = 1; l <= q; l++) {
          printf("%c", s[pos]);
          pos++;
        }
        puts("");
      }
      return 0;
    }
  }
  puts("-1");
}
