#include <bits/stdc++.h>
using namespace std;
int main() {
  int test_case;
  cin >> test_case;
  while (test_case--) {
    int n, a, b;
    cin >> n >> a >> b;
    char akash[n];
    akash[0] = '\0';
    int swarna = 0;
    for (int i = 0; i < n; i++) {
      if (swarna == b) {
        swarna = 0;
      }
      akash[i] = (char)swarna + 97;
      swarna++;
    }
    akash[n] = '\0';
    cout << akash << endl;
  }
  return 0;
}
