#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e6 + 7;
const int maxm = 2e3 + 7;
const int mod = 998244353;
long long ans = 0, tot = 0, tot1, tot2;
long long a[maxn], b[maxn], p[maxn], last[maxm], f[maxm], dp[200][200];
bool flag[maxn], vis[maxn], vis1[maxn];
struct node {
  char c;
  long long x, y, z;
  node(int x = 0, int y = 0, int z = 0) : x(x), y(y), z(z) {}
  bool operator<(const node& n) {
    if (z == n.z) return y < n.y;
    return z > n.z;
  }
};
node ve[maxn];
vector<int> v;
long long C[200][200];
void trangle() {
  C[1][1] = C[2][1] = C[2][2] = 1;
  for (register int i = 3; i <= 150; i++) {
    for (register int j = 1; j <= i; j++) {
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
    }
  }
}
int main() {
  string s1, s2;
  long long n, m, k;
  long long x, y;
  map<int, int> mp;
  int t;
  cin >> t;
  while (t--) {
    s1 = "";
    cin >> n >> m >> k;
    int f = floor(1.0 * m / k);
    int s = ceil(1.0 * m / f);
    for (register int i = 1; i <= s; i++) {
      for (register int j = 1; j <= f; j++) {
        s1 += 'a' + (i - 1) % k;
      }
    }
    s1 = s1.substr(0, m);
    int len = s1.size();
    for (register int i = 1; i <= n; i++) {
      cout << s1[(i - 1) % len];
    }
    cout << '\n';
  }
}
