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