#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a, b;
    cin >> n >> a >> b;
    int same = a - b + 1;
    int ch = 97;
    int temp = 0;
    string s;
    for (int i = 0; i < a; i++) {
      if (i < same) {
        s.push_back((char)ch);
        continue;
      }
      temp++;
      s.push_back((char)(ch + temp));
    }
    cout << s;
    for (int i = 0; i < (n - a); i++) {
      cout << s[i % a];
    }
    cout << endl;
  }
  return 0;
}
