#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n, a, b;
    cin >> n >> a >> b;
    char s[2001];
    int Counter = 0;
    for (int j = 0; j < n; j++) {
      s[j] = (char)Counter + 97;
      Counter++;
      if (Counter == b) {
        Counter = 0;
      }
    }
    for (int j = 0; j < n; j++) cout << s[j];
    cout << endl;
  }
}
