#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    string str = "";
    int n, a, b;
    cin >> n >> a >> b;
    for (int j = 0; j < b; j++) {
      char c = char(97 + j);
      str = str + c;
    }
    int temp = n / b;
    string str2 = str;
    for (int j = 0; j < temp - 1; j++) {
      str += str2;
    }
    int pending = n % b;
    string extra = "";
    for (int j = 0; j < pending; j++) {
      extra += str[j];
    }
    str += extra;
    cout << str << endl;
  }
  return 0;
}
