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