#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, p, q, x, y, pos = 0;
  string s;
  bool found = false;
  cin >> n >> p >> q >> s;
  for (x = 0; x <= n; x++) {
    for (y = 0; y <= n; y++) {
      if (p * x + q * y == n) {
        found = true;
        break;
      }
    }
    if (found) break;
  }
  if (found) {
    cout << x + y << endl;
    while (x) {
      cout << s.substr(pos, p) << endl;
      pos += p;
      x--;
    }
    while (y) {
      cout << s.substr(pos, q) << endl;
      pos += q;
      y--;
    }
  } else
    cout << -1;
  return 0;
}
