#include <bits/stdc++.h>
int main() {
  int n, p, q;
  std::cin >> n >> p >> q;
  std::string s;
  std::cin >> s;
  bool ok = false;
  for (int k1 = 0; k1 * p <= n; ++k1) {
    for (int k2 = 0; k2 * q + k1 * p <= n; ++k2) {
      if (k1 * p + k2 * q == n) {
        ok = true;
        std::cout << (k1 + k2) << '\n';
        for (int i = 0; i < k1; ++i)
          std::cout << std::string(s.begin() + i * p, s.begin() + i * p + p)
                    << '\n';
        for (int i = 0; i < k2; ++i)
          std::cout << std::string(s.begin() + k1 * p + i * q,
                                   s.begin() + k1 * p + i * q + q)
                    << '\n';
        break;
      }
    }
    if (ok) break;
  }
  if (!ok) std::cout << (-1) << '\n';
  return 0;
}
