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