const abc = "abcdefghij";

function func(len, str){
  if(len === str.length){
    console.log(str);
    return;
  }
  for(var i=0; i<str.length+1; i++){
    func(len, str+abc[i]);
  }
}

function Main(input) {
        input = input.split("\n");
        tmp = input[1].split(" ");
        var k = parseInt(input[0], 10);
        func(k, "");
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));