#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  ;
  int n, a, b, t;
  cin >> t;
  while (t--) {
    cin >> n >> a >> b;
    string part, result = "";
    char ch = 'a';
    for (int i = 0; i < a - b + 1; i++) {
      part.push_back(ch);
    }
    ch++;
    for (int i = 0; i < b - 1; i++) {
      part.push_back(ch);
      if (ch == 'z')
        ch = 'a';
      else {
        ch++;
      }
    }
    while (n) {
      if (n >= a) {
        n -= a;
        result += part;
      } else {
        for (int i = 0; i < n; i++) {
          result.push_back(part[i]);
        }
        n = 0;
      }
    }
    cout << result << endl;
  }
  return 0;
}
