#include <bits/stdc++.h>
char arr[3000];
using namespace std;
int main() {
  int test;
  scanf("%d", &test);
  while (test--) {
    int n, a, b;
    cin >> n >> a >> b;
    char p = 'a';
    int cnt = 0;
    for (int i = 0; i < n; i++, cnt++) {
      if (cnt % b == 0) {
        p = 'a';
      }
      arr[i] = p++;
    }
    for (int i = 0; i < n; i++) cout << arr[i];
    printf("\n");
    memset(arr, 0, sizeof(arr));
  }
}
