#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int sz, a, b, x = 0, y = 0;
  string str;
  cin >> sz >> a >> b;
  cin >> str;
  for (int i = 0; i <= 100; i++) {
    int j = (sz - a * i) / b;
    if (j < 0) break;
    if (j > 0 && a * i + b * j == sz) {
      x = i;
      y = j;
      break;
    }
  }
  if (x == 0 && y == 0) {
    for (int i = 0; i <= 100; i++) {
      int j = (sz - b * i) / a;
      if (j < 0) break;
      if (j > 0 && b * i + a * j == sz) {
        x = j;
        y = i;
        break;
      }
    }
  }
  if (x == 0 && y == 0)
    cout << -1 << "\n";
  else {
    cout << x + y << "\n";
    for (int i = 0; i < x * a; i += a) {
      cout << str.substr(i, a) << "\n";
    }
    for (int j = x * a; j < sz; j += b) {
      cout << str.substr(j, b) << "\n";
    }
  }
}
