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