#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, a, b;
    cin >> n >> a >> b;
    long long int i, j = 0, k = 0;
    char s[n + 1], c[b + 1];
    while (b--) {
      c[j] = 'a' + j;
      s[j] = c[j];
      j++;
    }
    for (i = j; i < n; i++) {
      s[i] = c[k++];
      if (k == j) k = 0;
    }
    s[i] = '\0';
    cout << s << endl;
  }
  return 0;
}
