#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:20000000")
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
void solve() {
  int n = ri(), p = ri(), q = ri();
  string s;
  cin >> s;
  for (int i = (int)(0); i <= (int)(100); i++) {
    int ost = n - p * i;
    if (ost < 0) break;
    if (ost % q == 0) {
      cout << i + ost / q << endl;
      int pos = 0;
      for (int j = 1; j <= i; j++) {
        for (int k = 0; k < p; k++) cout << s[pos++];
        cout << endl;
      }
      for (int j = 1; j <= ost / q; j++) {
        for (int k = 0; k < q; k++) cout << s[pos++];
        cout << endl;
      }
      return;
    }
  }
  cout << -1 << endl;
}
int main() {
  solve();
  return 0;
}
