#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
const int MAX = 1e9 + 7;
const int MIN = -1e9 + 7;
using namespace std;
int const inf = 2e9;
int main() {
  int TEST;
  cin >> TEST;
  for (int T = (1); T < (int)(TEST + 1); ++T) {
    int n, a, b;
    cin >> n >> a >> b;
    string s = "";
    int rem = n / a;
    while (rem--) {
      for (int i = 0; i < b; i++) {
        s += 'a' + i;
      }
      for (int i = 0; i < a - b; i++) {
        s += 'a';
      }
    }
    int md = n % a;
    for (int i = 0; i < min(md, b); i++) s += 'a' + i;
    md -= b;
    if (md > 0) {
      for (int i = 0; i < md; i++) {
        s += 'a';
      }
    }
    cout << s << "\n";
  }
  return 0;
}
