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