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