#include <bits/stdc++.h>
using namespace std;
char str[2009];
int main() {
  int t, n, i, a, b;
  scanf("%d", &t);
  while (t--) {
    scanf("%d %d %d", &n, &a, &b);
    for (i = 0; i < b; i++) {
      str[i] = 'a' + i;
    }
    while (i < a) {
      str[i] = str[i - 1];
      i++;
    }
    while (i < n) {
      str[i] = str[i - a];
      i++;
    }
    str[n] = '\0';
    printf("%s\n", str);
  }
  return 0;
}
