#include <bits/stdc++.h>
using namespace std;
int n, p, q;
string s;
int main() {
  cin >> n >> p >> q >> s;
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= 100; j++) {
      if (n == i * p + j * q) {
        cout << i + j << endl;
        int k = 0;
        for (int i2 = 1; i2 <= i; i2++) {
          cout << s.substr(k, p) << endl;
          ;
          k += p;
        }
        for (int j2 = 1; j2 <= j; j2++) {
          cout << s.substr(k, q) << endl;
          k += q;
        }
        return 0;
      }
    }
  }
  cout << -1 << endl;
  return 0;
}
