#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, q;
  cin >> n >> p >> q;
  string x;
  cin >> x;
  int ansp = -1, ansq = -1;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      if (i * p + j * q == n) {
        ansp = i;
        ansq = j;
      }
    }
  }
  if (ansp == -1) {
    cout << -1;
    return 0;
  }
  cout << ansp + ansq << endl;
  int k = 0;
  while (ansp--) {
    for (int i = 0; i < p; i++) {
      cout << x[k];
      k++;
    }
    cout << endl;
  }
  while (ansq--) {
    for (int i = 0; i < q; i++) {
      cout << x[k];
      k++;
    }
    cout << endl;
  }
  return 0;
}
