#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, q;
  cin >> n >> p >> q;
  string ss;
  cin >> ss;
  vector<string> v;
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= 100; j++) {
      if (i * p + j * q == n) {
        int c = i;
        int cc = j;
        int g = 0;
        while (c + cc > 0) {
          string s = "";
          if (c > 0) {
            for (int k = g; k < g + p; k++) {
              s += ss[k];
            }
            g += p;
            c--;
          } else if (cc > 0) {
            for (int k = g; k < g + q; k++) {
              s += ss[k];
            }
            g += q;
            cc--;
          }
          v.push_back(s);
        }
        cout << v.size() << endl;
        for (int qq = 0; qq < v.size(); qq++) {
          cout << v[qq] << endl;
        }
        return 0;
      }
    }
  }
  cout << -1 << endl;
  return 0;
}
