#include<bits/stdc++.h>
using namespace std;

char enc(int k) {
    return 'a' + k;
}

string solve(int k) {
    string res;
    char c = enc(k);
    if (k == 0) {
        res.push_back(c);
        return res;
    }
    res.push_back(c);
    res.push_back(c);
    for (int i = 0; i < k - 1; i++) {
        res.push_back(enc(i));
        res.push_back(c);
    }
    res += solve(k - 1);
    res.push_back(enc(k - 1));
    return res;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, k;
    cin >> n >> k;
    string s = solve(k - 1);
    // cout << s << endl;

    string res;
    for (int i = 0; i < n; i++) {
        res.push_back(s[i % s.size()]);
    }
    cout << res << '\n';

    return 0;
}
