#include <bits/stdc++.h>
using namespace std;
long long int n, i, j, md, hi, lo, mx, h, flag, k, sum, x, t, y, w, ans, q, hsh;
long long int a[1000002], dp[1000007], b[1000007];
map<char, char> m;
stack<char> stk;
int main() {
  ios::sync_with_stdio(false);
  long long int p, q;
  cin >> n >> p >> q;
  string s;
  cin >> s;
  flag = 0;
  for (i = 0; i <= n / p; i++) {
    if ((n - p * i) % q == 0) {
      flag = 1;
      x = i;
      y = (n - p * i) / q;
      break;
    }
  }
  if (flag == 0) {
    cout << "-1\n";
  } else {
    cout << x + y << endl;
    for (i = 0; i < x * p;) {
      for (j = i; j < (i + p); j++) {
        cout << (char)s[j];
      }
      i += p;
      cout << endl;
    }
    for (i = x * p; i < n;) {
      for (j = i; j < (i + q); j++) {
        cout << (char)s[j];
      }
      i += q;
      cout << endl;
    }
  }
}
