#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, p, q, a, b = -1;
  cin >> n >> p >> q >> s;
  for (a = 0; a <= n / p; a++)
    if ((n - a * p) % q == 0) {
      b = (n - a * p) / q;
      break;
    }
  if (b == -1) {
    cout << "-1" << endl;
    exit(0);
  }
  cout << a + b << endl;
  for (int i = 1; i <= a; i++) cout << s.substr(p * (i - 1), p) << endl;
  for (int i = 1; i <= b; i++) cout << s.substr(a * p + q * (i - 1), q) << endl;
}
