#include <bits/stdc++.h>
using namespace std;
int n, p, q, a[105];
string s;
pair<int, int> sol[101];
int main() {
  cin >> n >> p >> q >> s;
  a[0] = true;
  for (int j = 0; j <= max(0, n - p); j++)
    if (a[j + p] == false && a[j] == true) {
      a[j + p] = true;
      sol[j + p] = make_pair(sol[j].first + 1, sol[j].second);
    }
  for (int j = 0; j <= max(0, n - q); j++)
    if (a[j + q] == false && a[j] == true) {
      a[j + q] = true;
      sol[j + q] = make_pair(sol[j].first, sol[j].second + 1);
    }
  if (a[n] == false)
    cout << "-1\n";
  else {
    cout << sol[n].first + sol[n].second << '\n';
    int k = 0;
    for (int i = 1; i <= sol[n].first; i++) {
      for (int j = 1; j <= p; j++) {
        cout << s[k];
        k++;
      }
      cout << '\n';
    }
    for (int i = 1; i <= sol[n].second; i++) {
      for (int j = 1; j <= q; j++) {
        cout << s[k];
        k++;
      }
      cout << '\n';
    }
  }
  return 0;
}
