#include <bits/stdc++.h>
using namespace std;
char mat[110][110];
long long int ans[110][110];
char arr[100];
int start = 0;
int main() {
  for (char ch = '0'; ch <= '9'; ch++) {
    arr[start++] = ch;
  }
  for (char ch = 'a'; ch <= 'z'; ch++) arr[start++] = ch;
  for (char ch = 'A'; ch <= 'Z'; ch++) arr[start++] = ch;
  long long int t, r, c, k;
  cin >> t;
  while (t--) {
    cin >> r >> c >> k;
    long long int sum = 0;
    for (long long int i = 0; i < r; i++) {
      cin >> mat[i];
      for (long long int j = 0; j < c; j++)
        if (mat[i][j] == 'R') sum++;
    }
    long long int sum1 = sum / k;
    long long int sum3 = sum % k;
    long long int r1 = 0, c1 = 0;
    long long int flag1 = 0, flag2 = 1;
    long long int cnt = 1, p = 0;
    long long int sum2 = 0;
    while (1) {
      if (p == sum % k) break;
      if (mat[r1][c1] == 'R') sum2++;
      ans[r1][c1] = cnt;
      if (c1 == c - 1 && flag1 == 0) {
        r1++;
        flag1 = 1;
        flag2 = 0;
      } else if (c1 == 0 && flag2 == 0) {
        r1++;
        flag2 = 1;
        flag1 = 0;
      } else if (flag1 == 0)
        c1++;
      else if (flag2 == 0)
        c1--;
      if (sum2 == sum1 + 1) {
        p++;
        cnt++;
        sum2 = 0;
      }
    }
    p = 0;
    while (1) {
      if (p == k - sum % k) break;
      if (mat[r1][c1] == 'R') sum2++;
      ans[r1][c1] = cnt;
      if (c1 == c - 1 && flag1 == 0) {
        r1++;
        flag1 = 1;
        flag2 = 0;
      } else if (c1 == 0 && flag2 == 0) {
        r1++;
        flag2 = 1;
        flag1 = 0;
      } else if (flag1 == 0)
        c1++;
      else if (flag2 == 0)
        c1--;
      if (sum2 == sum1) {
        p++;
        cnt++;
        sum2 = 0;
      }
    }
    cnt--;
    while (1) {
      if (r1 >= r || c1 >= c || r1 < 0 || c1 < 0) break;
      ans[r1][c1] = cnt;
      if (c1 == c - 1 && flag1 == 0) {
        r1++;
        flag1 = 1;
        flag2 = 0;
      } else if (c1 == 0 && flag2 == 0) {
        r1++;
        flag2 = 1;
        flag1 = 0;
      } else if (flag1 == 0)
        c1++;
      else if (flag2 == 0)
        c1--;
    }
    for (long long int i = 0; i < r; i++) {
      for (long long int j = 0; j < c; j++) cout << arr[ans[i][j] - 1];
      cout << endl;
    }
  }
  return 0;
}
