#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, t, ans, p, k, q;
int main() {
  ios_base::sync_with_stdio(0);
  static const size_t npos = -1;
  cin >> n >> p >> q;
  string s;
  cin >> s;
  for (i = 0; i <= n / p + 1; i++) {
    for (j = 0; i * p + j * q <= n; j++) {
      if (i * p + j * q == n) {
        t = 1;
        break;
      }
    }
    if (t) {
      break;
    }
  }
  if (!t) {
    cout << -1 << endl;
    return 0;
  }
  cout << (i + j) << endl;
  for (k = 0, m = 0; m < i; k += p, m++) {
    cout << (s.substr(k, p)) << endl;
  }
  for (k = p * i, m = 0; m < j; k += q, m++) {
    cout << (s.substr(k, q)) << endl;
  }
  return 0;
}
