#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string s;
    int n, a, b;
    cin >> n >> a >> b;
    string h = "abcdefghijklmnopqrstuvwxyz";
    for (int i = 0; i < a; i++) s += h[i % b];
    for (int i = a; i < n; i++) s += s[i - a];
    cout << s << endl;
  }
}
