#include <bits/stdc++.h>
using namespace std;
long long i, j;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  int aa = -1, bb = -1;
  int y = n / a;
  for (i = 0; i <= y; i++) {
    if ((n - i * a) % b == 0) {
      aa = i;
      bb = (n - i * a) / b;
      break;
    }
  }
  if (aa == -1) {
    cout << -1;
    return 0;
  }
  cout << aa + bb << endl;
  for (i = 0; i < n;) {
    if (aa > 0) {
      int u = a;
      while (u--) {
        cout << s[i];
        i++;
      }
      aa--;
    } else {
      int u = b;
      while (u--) {
        cout << s[i];
        i++;
      }
      bb--;
    }
    cout << endl;
  }
}
