#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, q, pN = 0, qN = 0;
  cin >> n >> p >> q;
  string s;
  cin >> s;
  bool canDivide = false;
  for (pN = 0; pN <= n && !canDivide; pN++) {
    qN = (n - p * pN) / q;
    if (qN >= 0 && n == q * qN + p * pN) {
      canDivide = true;
      break;
    }
  }
  if (canDivide) {
    cout << pN + qN << endl;
    int pt = 0;
    for (int i = 0; i < pN; i++) {
      cout << s.substr(pt, p) << endl;
      pt += p;
    }
    for (int j = 0; j < qN; j++) {
      cout << s.substr(pt, q) << endl;
      pt += q;
    }
  } else {
    cout << -1;
  }
  return 0;
}
