#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
char h[2005] = {0};
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n, a, b;
    cin >> n >> a >> b;
    for (int j = 0; j < a; j++) {
      h[j] = 'a' - 1 + min(j + 1, b);
      cout << h[j];
    }
    for (int j = a; j < n; j++) {
      h[j] = h[j % a];
      cout << h[j];
    }
    cout << endl;
  }
  return 0;
}
