#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a, b;
    string s = "", s1;
    cin >> n >> a >> b;
    for (int i = 0; i < b; i++) s += ('a' + i);
    for (int i = b; i < a; i++) s += 'a';
    s1 = s;
    int x = n / a, y = n % a;
    x--;
    while (x--) {
      s += s1;
    }
    for (int i = 0; i < y; i++) s += s1[i];
    cout << s << endl;
  }
}
