#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, a, b, i;
  cin >> t;
  while (t--) {
    cin >> n >> a >> b;
    int j = 97;
    int count = 0;
    for (i = 1; i <= n; i++, j++) {
      printf("%c", j);
      count++;
      if (count == b) {
        j = 96;
        count = 0;
      }
    }
    printf("\n");
  }
  return 0;
}
