#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a, b;
    cin >> n >> a >> b;
    string sub = "";
    string ans = "";
    for (int i = 0; i < a; i++) {
      if (b > 0) {
        char ch = 'a' + i;
        sub += ch;
        b--;
      } else {
        char ch = sub[sub.length() - 1];
        sub += sub[sub.length() - 1];
      }
    }
    for (int i = 0; i < n; i++) {
      ans += sub[i % a];
    }
    cout << ans << endl;
  }
  return 0;
}
