#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
signed main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string s;
  int n, a, b;
  cin >> n >> a >> b >> s;
  for (int i = 0; i <= n / a; i++) {
    if ((n - i * a) % b == 0) {
      cout << i + (n - i * a) / b << endl;
      for (int j = 0; j < i * a; j++) {
        cout << s[j];
        if ((j + 1) % a == 0) cout << endl;
      }
      for (int j = i * a, k = 0; j < n; j++, k++) {
        cout << s[j];
        if ((k + 1) % b == 0) cout << endl;
      }
      return 0;
    }
  }
  cout << "-1\n";
  return 0;
}
