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