#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, n, a, b, i, j, distinct;
  cin >> T;
  while (T--) {
    cin >> n >> a >> b;
    string s;
    s.append(n, 'a');
    int freq[26] = {0};
    freq[0] = 1;
    distinct = 1;
    for (i = 1; i < a; i++) {
      if (distinct < b) {
        s[i] = (char)(s[i - 1] + 1);
        distinct++;
      }
      freq[s[i] - 'a']++;
    }
    for (i = a; i < n; i++) {
      freq[s[i - a] - 'a']--;
      if (freq[s[i - a] - 'a'] == 0) distinct--;
      if (distinct < b) {
        for (j = 0; j < 26; j++) {
          if (freq[j] == 0) break;
        }
        s[i] = (char)(j + 'a');
        freq[s[i] - 'a']++;
        distinct++;
      }
    }
    cout << s << "\n";
  }
  return 0;
}
