description: You are given an integer k and a string s that consists only of characters 'a' (a lowercase Latin letter) and '*' (an asterisk).
  
  Each asterisk should be replaced with several (from 0 to k inclusive) lowercase Latin letters 'b'. Different asterisk can be replaced with different counts of letter 'b'.
  
  The result of the replacement is called a BA-string.
  
  Two strings a and b are different if they either have different lengths or there exists such a position i that a_i ≠ b_i.
  
  A string a is lexicographically smaller than a string b if and only if one of the following holds: 
  
    * a is a prefix of b, but a ≠ b; 
    * in the first position where a and b differ, the string a has a letter that appears earlier in the alphabet than the corresponding letter in b. 
  
  
  
  Now consider all different BA-strings and find the x-th lexicographically smallest of them.
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 2000) — the number of testcases.
  
  The first line of each testcase contains three integers n, k and x (1 ≤ n ≤ 2000; 0 ≤ k ≤ 2000; 1 ≤ x ≤ 10^{18}). n is the length of string s.
  
  The second line of each testcase is a string s. It consists of n characters, each of them is either 'a' (a lowercase Latin letter) or '*' (an asterisk).
  
  The sum of n over all testcases doesn't exceed 2000. For each testcase x doesn't exceed the total number of different BA-strings. String s contains at least one character 'a'.
  
  Output
  
  For each testcase, print a single string, consisting only of characters 'b' and 'a' (lowercase Latin letters) — the x-th lexicographically smallest BA-string.
  
  Example
  
  Input
  
  
  3
  2 4 3
  a*
  4 1 3
  a**a
  6 3 20
  **a***
  
  
  Output
  
  
  abb
  abba
  babbbbbbbbb
  
  Note
  
  In the first testcase of the example, BA-strings ordered lexicographically are: 
  
    1. a
    2. ab
    3. abb
    4. abbb
    5. abbbb
  
  
  
  In the second testcase of the example, BA-strings ordered lexicographically are: 
  
    1. aa
    2. aba
    3. abba
  
  
  
  Note that string "aba" is only counted once, even though there are two ways to replace asterisks with characters 'b' to get it.
solution: import java.io.*;
  import java.util.*;
  import java.math.*;
  
  import javax.lang.model.element.NestingKind;
  
  import com.sun.source.tree.Tree;
  
  public class A3 {
      
      void solve() {
          int n = cint();
          long k = clong();
          long x = clong();
          String s = cstr();
          
          cout(solve(k, x, s));
      }
  
      String[] seria(char[] s) {
          List<String> seria = new ArrayList<>();
          String w = "" + s[0];
          for (int i = 1; i < s.length; i++) {
              if (s[i-1] != s[i]) {
                  seria.add(w);
                  w = "";
              }
              w += s[i];
          }
          if (!w.isEmpty()) {
              seria.add(w);
          }
          return seria.toArray(new String[0]);
      }
      
      String solve(long k, long x, String S) {
          char[] s = S.toCharArray();
          if (S.indexOf('*') < 0) {
              return S;
          }
          
          String[] seria = seria(s);
  
          Token[] T;
          {
              List<Token> tokens = new ArrayList<>();
              Token t = new Token();
              int i = 0;
              if (seria[0].startsWith("a")) {
                  t.before = seria[0];
                  i++;
              }
              for (; i < seria.length; i++) {
                  if (seria[i].startsWith("*")) {
                      t.count = seria[i].length();
                      tokens.add(t);
                  } else {
                      t.after = seria[i];
                      t = new Token();
                  }
              }
              T = tokens.toArray(new Token[0]);
          }
          
          int m = T.length;
          long[] a = new long[m];
          if (m == 0) {
              return S;
          }
  
          for (int i = 0; i < m; i++) {
              a[i] = k * T[i].count + 1;
          }
          long[] b = new long[m+1];
          b[m] = 1;
          for (int i = m-1; i >= 0; i--) {
              double test = (double)b[i+1] * (double)a[i];
              if (test > 1e18) {
                  break;
              }
              b[i] = b[i+1] * a[i];
          }
          
          long[] c = new long[m];
          long y = x - 1;
          for (int i = 0; i < m; i++) {
              if (b[i+1] > 0) {
                  c[i] = y / b[i+1];
                  y %= b[i+1];
              }
          }
          
          StringBuilder res = new StringBuilder();
          for (int i = 0; i < m; i++) {
              res.append(T[i].before);
              for (int j = 0; j < c[i]; j++) {
                  res.append('b');
              }
              res.append(T[i].after);
          }
          
          return res.toString();
      }
  
      class Token {
          String before = "";
          int count;
          String after = "";
      }
      
      public static void main(String... args) {
          int t = in.nextInt();
          for (int test = 0; test < t; test++) {
              new A3().solve();
          }
          
  //        check(new A3(), "aaa*******", 0);
          
          
  //        new A3().solve(2000, Long.MAX_VALUE-1000, "a******a*********a**********a**********a*********a**********a*********a*************************************a**************a***********a****************a*************a**************a*******************a************************a**************************a*************************a*****");
  //        
  //
  //        for (int i = 0; i < 10000; i++) {
  //            String s = randomString();
  //            //System.out.println(s);
  //            for (int k = 0; k < 4; k++) {
  //                check(new A3(), s, k);
  //            }
  //        }
  
          out.flush();
      }
      
      static void check(A3 a3, String s, int k) {
          TreeSet<String> all = all(s, k);
          //System.out.println(all.size() + " size");
          int x = 1;
          for(String exp : all) {
              String value = a3.solve(k, x, s);
              //System.out.println("exp: " + exp + ", value: " + value);
              
              if (!exp.equalsIgnoreCase(value)) {
                  System.out.println("WRONG!!" + k + " " + x + " " + s);
                  System.out.println("exp: " + exp + ", value: " + value);
                  return;
              }
              x++;
          }
      }
      
      static String randomString() {
          Random rnd = new Random();
          while (true) {
              int len = rnd.nextInt(10) + 1;
              String s = "";
              for (int i = 0; i < len; i++) {
                  s += rnd.nextInt(2) == 1 ? 'a' : '*';
              }
              
              if (s.indexOf('a') >= 0) {
                  return s;
              }
          }
      }
      
      static TreeSet<String> all(String s, int k) {
          TreeSet<String> set = new TreeSet<>();
          dfs(set, s, 0, "", k);
          return set;
      }
      
      static void dfs(Set<String> set, String s, int index, String res, int k) {
          if (index >= s.length()) {
              set.add(res);
              return;
          }
          if (s.charAt(index) == 'a') {
              dfs(set, s, index+1, res + "a", k);
          } else {
              for (int i = 0; i <= k; i++) {
                  dfs(set, s, index+1, res, k);
                  res += 'b';
              }
          }
      }
      
      static final QuickReader in = new QuickReader(System.in);
      static final PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out, 131_072));
  
      static int cint() {
          return in.nextInt();
      }
  
      static long clong() {
          return in.nextLong();
      }
  
      static String cstr() {
          return in.nextLine();
      }
  
      static int[] carr_int(int n) {
          return in.nextInts(n);
      }
  
      static long[] carr_long(int n) {
          return in.nextLongs(n);
      }
  
      static void cout(int... a) {
          StringBuilder buf = new StringBuilder();
          for (int i = 0; i < a.length; i++) {
              if (i != 0) {
                  buf.append(' ');
              }
              buf.append(a[i]);
          }
          out.println(buf);
      }
  
      static void cout(long... a) {
          StringBuilder buf = new StringBuilder();
          for (int i = 0; i < a.length; i++) {
              if (i != 0) {
                  buf.append(' ');
              }
              buf.append(a[i]);
          }
          out.println(buf);
      }
  
      static void cout(Object o) {
          out.println(o);
      }
  
      static class QuickReader {
          BufferedReader in;
          StringTokenizer token;
  
          public QuickReader(InputStream ins) {
              in = new BufferedReader(new InputStreamReader(ins));
              token = new StringTokenizer("");
          }
  
          public boolean hasNext() {
              while (!token.hasMoreTokens()) {
                  try {
                      String s = in.readLine();
                      if (s == null) {
                          return false;
                      }
                      token = new StringTokenizer(s);
                  } catch (IOException e) {
                      throw new InputMismatchException();
                  }
              }
              return true;
          }
  
          public String next() {
              hasNext();
              return token.nextToken();
          }
  
          public String nextLine() {
              try {
                  String s = in.readLine();
                  token = new StringTokenizer("");
                  return s;
              } catch (IOException e) {
                  throw new InputMismatchException();
              }
          }
  
          public int nextInt() {
              return Integer.parseInt(next());
          }
  
          public int[] nextInts(int n) {
              int[] res = new int[n];
              for (int i = 0; i < n; i++) {
                  res[i] = nextInt();
              }
              return res;
          }
  
          public long nextLong() {
              return Long.parseLong(next());
          }
  
          public long[] nextLongs(int n) {
              long[] res = new long[n];
              for (int i = 0; i < n; i++) {
                  res[i] = nextLong();
              }
              return res;
          }
      }
  }
  