// chrono::system_clock::now().time_since_epoch().count()
#include <bits/stdc++.h>

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define debug(x) cerr << #x << " = " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;

void yes(){
    cout<<"YES"<<'\n';
}

void no(){
    cout<<"NO"<<'\n';
}

bool was[26][26];
void solve() {
    int n,k;
    cin>>n>>k;
    string ans = "a";
    int cur = 1;
    while(ans.length()<n){
        vi rep;
        int loc = cur;
        int f;
        int s;
        s = loc%k;
        loc/=k;
        f = loc%k;
        if(s<=f){
            s=f;
            ans+=(f+'a');
        }else{
            ans+=(f+'a');
            if(ans.length()<n){
                ans+=(s+'a');
            }
        }
        cur = f*k + s;
        cur++;
    }


    cout<<ans<<'\n';
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int tt = 1;
    while (tt--) {
        solve();
    }

    return 0;
}

