#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int l;
  int a, b;
  string n;
  cin >> l >> a >> b;
  cin >> n;
  int y, z;
  int fl = 0;
  for (int i = 0; i <= (l / a); i++) {
    for (int j = 0; j <= (l / b); j++) {
      if (((a * i) + (b * j)) == l) {
        y = i;
        z = j;
        fl = 1;
        break;
      }
    }
  }
  if (fl == 1) cout << y + z << endl;
  if (fl == 0) {
    cout << -1;
    return 0;
  }
  int j = 0;
  for (int i = 0; i < y; i++) {
    string an = "";
    for (int c = 0; c < a; j++, c++) {
      an += n[j];
    }
    cout << an << endl;
  }
  for (int i = 0; i < z; i++) {
    string an = "";
    for (int c = 0; c < b; j++, c++) {
      an += n[j];
    }
    cout << an << endl;
  }
  return 0;
}
