#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0;
  cin >> t;
  for (int test = 0; test < t; ++test) {
    int n, a, b;
    cin >> n >> a >> b;
    int an = 0, bn = 0;
    for (int i = 0; i < n; ++i) {
      if (an < a) {
        if (bn < b - 1) {
          printf("%c", (97 + bn));
          bn++;
          an++;
        } else {
          printf("%c", (97 + bn));
          an++;
        }
      } else {
        an = 0;
        bn = 0;
        i--;
      }
    }
    cout << endl;
  }
  return 0;
}
