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