#include <bits/stdc++.h>
using namespace std;
const long long int N = 2e5 + 5;
void solve() {
  long long n, a, b;
  cin >> n >> a >> b;
  long long p = a / b;
  if (a % b) p++;
  string s;
  for (long long int i = 0; i < b; i++) {
    s += (char)('a' + i);
  }
  for (long long int i = 0; i < n; i++) {
    cout << s[i % (b)];
  }
  cout << "\n";
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
