#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, i, j, l, m;
  char st[2002], k;
  cin >> a;
  while (a--) {
    cin >> b >> c >> d;
    j = 0;
    k = 'a';
    l = 0;
    for (i = 0; i < b; i++) {
      if (j == c || l == d) {
        k = 'a';
        l = 0;
        if (j == c) j = 0;
      }
      st[i] = k;
      k++;
      j++;
      l++;
    }
    st[b] = '\0';
    cout << st << endl;
  }
  return 0;
}
