#include <bits/stdc++.h>
using namespace std;
int n, a, b;
string s;
vector<int> ans;
int main() {
  scanf("%d%d%d", &n, &a, &b);
  cin >> s;
  s = " " + s;
  while (n > 0) {
    if (n % a == 0) {
      for (int i = 1; i <= n / a; ++i) ans.push_back(a);
      n = 0;
      break;
    }
    if (n % b == 0) {
      for (int i = 1; i <= n / b; ++i) ans.push_back(b);
      n = 0;
      break;
    }
    ans.push_back(a);
    ans.push_back(b);
    n -= a + b;
  }
  if (n == 0) {
    int sum = 0;
    cout << (int)ans.size() << endl;
    for (int i = 0; i < (int)ans.size(); ++i) {
      int now = ans[i];
      for (int j = sum + 1; j <= sum + ans[i]; ++j) cout << s[j];
      cout << endl;
      sum += ans[i];
    }
  } else
    printf("-1\n");
  return 0;
}
