#include <bits/stdc++.h>
using namespace std;
stack<string> s;
int dp[1000];
bool fn(string s1, int n, int p, int q, int curr) {
  if (curr == n) {
    dp[curr] = 1;
    return true;
  } else if (curr > n) {
    dp[curr] = -1;
    return false;
  }
  bool a;
  if (dp[curr + p] == 1)
    a = true;
  else if (dp[curr + p] == -1)
    a = false;
  else
    a = fn(s1, n, p, q, curr + p);
  if (a) {
    s.push(s1.substr(curr, p));
    dp[curr] = 1;
    return true;
  }
  if (dp[curr + q] == 1)
    a = true;
  else if (dp[curr + q] == -1)
    a = false;
  a = fn(s1, n, p, q, curr + q);
  if (a) {
    s.push(s1.substr(curr, q));
    dp[curr] = 1;
    return true;
  }
  dp[curr] = -1;
  return false;
}
int main() {
  int n, p, q;
  cin >> n >> p >> q;
  string s1;
  cin >> s1;
  bool a = fn(s1, n, p, q, 0);
  if (!a)
    cout << -1;
  else {
    cout << s.size() << endl;
    while (!s.empty()) {
      cout << s.top() << endl;
      s.pop();
    }
  }
  return 0;
}
