#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, q;
  string s;
  cin >> n >> p >> q >> s;
  int a, b, fl = 0;
  for (int i = (0); i <= (n / p); i++) {
    if ((n - i * p) % q == 0) {
      a = i;
      b = (n - i * p) / q;
      fl = 1;
      break;
    }
  }
  if (fl == 0)
    cout << -1;
  else {
    cout << a + b << endl;
    for (int i = (0); i <= (a - 1); i++) {
      for (int j = (0); j <= (p - 1); j++) cout << s[i * p + j];
      cout << endl;
    }
    for (int i = (0); i <= (b - 1); i++) {
      for (int j = (0); j <= (q - 1); j++) cout << s[a * p + i * q + j];
      cout << endl;
    }
  }
  return 0;
}
