#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, a, b;
    cin >> n >> a >> b;
    long long i;
    long long y = 97;
    char c[a];
    for (i = a - 1; i >= a - b; i--) {
      char c1 = char(y);
      c[i] = c1;
      y++;
    }
    for (i = 0; i < a - b; i++) {
      char c1 = char(y - 1);
      c[i] = c1;
    }
    string str = "";
    for (i = 0; i < a; i++) str = str + c[i];
    long long x = ceil(n / double(a));
    string s = "";
    for (i = 0; i < x; i++) s = s + str;
    for (i = 0; i < n; i++) cout << s[i];
    cout << "\n";
  }
}
