#include <bits/stdc++.h>
using namespace std;
int n, p, q;
string second;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> p >> q;
  cin >> second;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      if ((i || j) && i * p + j * q == n) {
        cout << i + j << endl;
        int c = i, k = 0;
        for (; k < n; k++)
          if (c) {
            cout << second[k];
            if ((k + 1) % p == 0) c--, cout << endl;
          } else
            break;
        c = j;
        int p = k;
        for (; k < n; k++)
          if (c) {
            cout << second[k];
            if ((k - p + 1) % q == 0) c--, cout << endl;
          }
        return 0;
      }
  cout << -1 << endl;
  return 0;
}
