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