#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, a, b;
  cin >> n >> a >> b;
  string s = "abcdefghijklmnopqrstuvwxyz";
  string ans;
  while (n) {
    if (n >= b) {
      ans += s.substr(0, b);
      n -= b;
    } else {
      for (long long i = 0; i < n; i++) {
        ans += string(1, i + 'a');
      }
      n = 0;
    }
  }
  cout << ans << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
