#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, q;
  string s;
  bool can = true;
  vector<string> vec;
  int aux = 0;
  int pos = 0;
  cin >> n >> p >> q;
  cin >> s;
  aux = n;
  if (n % p == 0) {
    cout << n / p << endl;
    for (int i = 0; i < n; i += p) {
      cout << s.substr(i, p) << endl;
    }
  } else if (n % q == 0) {
    cout << n / q << endl;
    for (int i = 0; i < n; i += q) {
      cout << s.substr(i, q) << endl;
    }
  } else {
    while (((aux % q != 0)) && pos < n) {
      vec.push_back(s.substr(pos, p));
      pos += p;
      aux -= p;
      if (aux < 0) {
        can = false;
      }
    }
    if (can) {
      while (pos < n) {
        vec.push_back(s.substr(pos, q));
        pos += q;
      }
      cout << vec.size() << endl;
      for (int i = 0; i < vec.size(); i++) {
        cout << vec[i] << endl;
      }
    } else {
      cout << -1;
    }
  }
  return 0;
}
