#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 1e5 + 10;
const long long INF = 1e9 + 10;
const long long mod = 1e18;
ofstream out("output.txt");
ifstream in("intput.txt");
long long bpow(long long t, long long n) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) ans = (ans * t) % mod;
    t = (t * t) % mod, n >>= 1;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(12);
  string s;
  long long n, p, q;
  cin >> n >> p >> q >> s;
  for (long long i = 0; i <= n; i++)
    for (long long j = 0; j <= n; j++) {
      cerr << i << " " << j << endl;
      if (i * p + j * q == n) {
        long long k = 0;
        cout << i + j << endl;
        for (; k < n && i; k++) {
          cout << s[k];
          if ((k + 1) % p == 0 && i) cout << endl, i--;
        }
        for (long long t = 0, aa = n - k; t < aa && j; k++, t++) {
          cout << s[k];
          if ((t + 1) % q == 0 && j) cout << endl, j--;
        }
        return 0;
      }
    }
  cout << -1;
}
