#include <bits/stdc++.h>
using namespace std;
int n, p, q;
string s;
vector<int> v;
int main() {
  cin >> n >> p >> q >> s;
  while (n != 0) {
    if (n % p == 0) {
      v.push_back(p);
      n -= p;
    } else if (n % q == 0) {
      v.push_back(q);
      n -= q;
    } else {
      n -= p;
      v.push_back(p);
    }
    if (n < 0) {
      cout << -1;
      return 0;
    }
  }
  int l = 0;
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    for (int j = 0; j < v[i]; j++) {
      cout << s[j + l];
    }
    l += v[i];
    cout << endl;
  }
}
