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