#include <bits/stdc++.h>
using namespace std;
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
int solve() {
  int n, a, b, i = 0, j = 0;
  cin >> n >> a >> b;
  char s[n];
  while (j < n) {
    if (i == a) i = 0;
    if (i < b)
      cout << (char)('a' + i);
    else if (i < a)
      cout << (char)('a' + b - 1);
    i++;
    j++;
  }
  cout << "\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
