#include <bits/stdc++.h>
long long mod = 1e9 + 9;
using namespace std;
string ss;
int n;
int main() {
  int t, i, j, q, k, l, rr, n, m;
  long long su;
  string ss;
  t = 1;
  int len;
  while (t--) {
    cin >> len >> n >> m;
    cin >> ss;
    int a = -1, b = -1;
    for (i = 0; i <= 100; ++i) {
      for (j = 0; j <= 100; ++j) {
        int sum = i * n + j * m;
        if (sum == len) {
          a = i;
          b = j;
        }
      }
      if (a != -1) break;
    }
    if (a == -1)
      cout << "-1\n";
    else {
      int st = 0;
      cout << a + b << endl;
      for (i = 1; i <= a; ++i) {
        for (j = st; j <= st + n - 1; ++j) cout << ss[j];
        st += n;
        cout << endl;
      }
      for (i = 1; i <= b; ++i) {
        for (j = st; j <= st + m - 1; ++j) cout << ss[j];
        st += m;
        cout << endl;
      }
    }
  }
}
