#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, q, x = 1;
  cin >> n >> p >> q;
  char a[105];
  cin >> a;
  int y = -1, z = 0;
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) {
      x = n;
      x = x - p * i - q * j;
      if (x == 0) {
        y = i;
        z = j;
        break;
      }
    }
  }
  if (y + z == -1) {
    cout << -1 << endl;
    return 0;
  }
  cout << z + y << endl;
  x = 0;
  for (int i = 0; i < y; i++) {
    for (int j = x; j < x + p; j++) cout << a[j];
    x += p;
    cout << endl;
  }
  for (int i = 0; i < z; i++) {
    for (int j = x; j < x + q; j++) cout << a[j];
    x += q;
    cout << endl;
  }
}
