#include <bits/stdc++.h>
void STRIKE(char chuoi[], int solan1, int dodaidoan1, int solan2,
            int dodaidoan2) {
  printf("%d\n", solan1 + solan2);
  char temp[101];
  strcpy(temp, chuoi);
  char d[101];
  int dem = 0;
  for (int i = 1; i <= solan1; i++) {
    for (int j = 1; j <= dodaidoan1; j++) {
      printf("%c", temp[dem]);
      dem++;
    }
    printf("\n");
  }
  for (int i = 1; i <= solan2; i++) {
    for (int j = 1; j <= dodaidoan2; j++) {
      printf("%c", temp[dem]);
      dem++;
    }
    printf("\n");
  }
}
bool Kiemtra(char s[], int x, int y, int n) {
  int dem = 0;
  while (n > 0) {
    n -= x;
    dem++;
    if (n % y == 0 && n >= 0) {
      STRIKE(s, dem, x, n / y, y);
      return true;
    }
  }
  return false;
}
int main() {
  int n, q, k;
  char s[101], temp;
  scanf("%d%d%d", &n, &q, &k);
  scanf("%c", &temp);
  gets(s);
  bool c;
  c = Kiemtra(s, q, k, n);
  if (c == false) c = Kiemtra(s, k, q, n);
  if (c == false) printf("-1");
}
