#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int t;
  cin >> t;
  for (int x = 0; x < (int)t; x++) {
    int n, a, b;
    cin >> n >> a >> b;
    string s = "";
    char c[b];
    for (int i = 0; i < (int)b; i++) c[i] = 'a' + i;
    int p = 0;
    for (int i = 0; i < (int)n; i++) {
      s += c[p];
      p = (p + 1) % b;
    }
    cout << s << endl;
  }
  return 0;
}
