#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, a, b, m, p, r, i, j, k, x, count1 = 0;
  cin >> t;
  while (t--) {
    cin >> n >> a >> b;
    string str = "", str1 = "";
    count1 = 0;
    if (a == b) {
      for (i = 0; i < b; i++) {
        str.push_back('a' + i);
        str1.push_back('a' + i);
      }
      count1 += b;
      i = 0;
      for (; count1 < n; i++) {
        i = i % b;
        str.push_back(str1[i]);
        count1 += 1;
      }
    } else {
      for (i = 0; i < b; i++) {
        str.push_back('a' + i);
        str1.push_back('a' + i);
      }
      count1 = 0;
      i = 0;
      for (; count1 < a - b; i++) {
        i = (i % b);
        str.push_back(str1[i]);
        count1++;
      }
      str1 = str;
      count1 = 0;
      for (i = 0; count1 < n - a; i++) {
        i = i % a;
        str.push_back(str1[i]);
        count1++;
      }
    }
    cout << str << endl;
  }
  return 0;
}
