#include <bits/stdc++.h>
using namespace std;
char farm[101][101];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int r, c, k;
    scanf("%d%d%d", &r, &c, &k);
    scanf("%c", &farm[0][0]);
    int rcnt = 0;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        scanf("%c", &farm[i][j]);
        if (farm[i][j] == 'R') rcnt++;
      }
      scanf("%c", &farm[100][100]);
    }
    int each = rcnt / k, more = rcnt % k;
    int cnt = 0, i = 0, j = 0, kcnt = 0;
    rcnt = 0;
    bool left = true, flag = false;
    while (cnt < r * c) {
      if (farm[i][j] == 'R') {
        rcnt++;
        farm[i][j] = kcnt < 10   ? (kcnt + '0')
                     : kcnt < 36 ? (kcnt + 'a' - 10)
                                 : (kcnt + 'A' - 36);
        if (rcnt == each + (kcnt < more) && kcnt < k - 1) {
          kcnt++;
          rcnt = 0;
        } else if (kcnt == k - 1) {
          flag = true;
        }
      } else {
        farm[i][j] = kcnt < 10   ? (kcnt + '0')
                     : kcnt < 36 ? (kcnt + 'a' - 10)
                                 : (kcnt + 'A' - 36);
        if (each + (kcnt < more) <= 0 && kcnt < k) {
          kcnt++;
        }
      }
      if (left) {
        if (j == c - 1) {
          i++;
          left = false;
        } else {
          j++;
        }
      } else {
        if (j == 0) {
          i++;
          left = true;
        } else {
          j--;
        }
      }
      cnt++;
    }
    while (kcnt < k && !flag) {
      i = 0;
      j = 1;
      left = true;
      while (true) {
        if (left &&
            ((farm[i][j] == ((j > 0) ? farm[i][j - 1] : farm[i - 1][j])) &&
             (farm[i][j] != ((j < c - 1) ? farm[i][j + 1] : farm[i + 1][j])))) {
          farm[i][j] = kcnt < 10   ? (kcnt + '0')
                       : kcnt < 36 ? (kcnt + 'a' - 10)
                                   : (kcnt + 'A' - 36);
          kcnt++;
          break;
        } else if ((!left) &&
                   ((farm[i][j] !=
                     ((j > 0) ? farm[i][j - 1] : farm[i + 1][j])) &&
                    (farm[i][j] ==
                     ((j < c - 1) ? farm[i][j + 1] : farm[i - 1][j])))) {
          farm[i][j] = kcnt < 10   ? (kcnt + '0')
                       : kcnt < 36 ? (kcnt + 'a' - 10)
                                   : (kcnt + 'A' - 36);
          kcnt++;
          break;
        }
        if (left) {
          if (j == c - 1) {
            i++;
            left = false;
          } else {
            j++;
          }
        } else {
          if (j == 0) {
            i++;
            left = true;
          } else {
            j--;
          }
        }
      }
    }
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        printf("%c", farm[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
