#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a, b;
    cin >> n >> a >> b;
    string s = "";
    for (char c = 'a'; c < 'a' + b; ++c) s += c;
    int q = n / b;
    int r = n % b;
    string ans = "";
    for (int i = 0; i < (q); ++i) ans += s;
    for (char c = 'a'; c < 'a' + r; ++c) ans += c;
    cout << ans << endl;
  }
}
