#include <bits/stdc++.h>
using namespace std;
const int INF = 1500000000;
const int MOD = 1000000007;
const int HASH = 137;
const int MAXNUM = 5005;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N, P, Q;
  string word;
  cin >> N >> P >> Q >> word;
  for (int i = 0; i * P <= N; i++) {
    if ((N - i * P) % Q == 0) {
      cout << i + (N - i * P) / Q << endl;
      int now = 0;
      for (int j = 0; j < i; j++, now += P) cout << word.substr(now, P) << endl;
      for (int j = 0; j < (N - i * P) / Q; j++, now += Q)
        cout << word.substr(now, Q) << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
