#include <bits/stdc++.h>
using namespace std;
vector<char> cs;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (char c = '0'; c <= '9'; c++) cs.push_back(c);
  for (char c = 'a'; c <= 'z'; c++) cs.push_back(c);
  for (char c = 'A'; c <= 'Z'; c++) cs.push_back(c);
  int t;
  cin >> t;
  while (t--) {
    int r, c, k;
    cin >> r >> c >> k;
    vector<string> board(r);
    int cnt = 0;
    for (int i = 0; i < r; i++) {
      cin >> board[i];
      for (int j = 0; j < c; j++) {
        if (board[i][j] == 'R') cnt++;
      }
    }
    int kosuu = cnt / k;
    int ooi = cnt % k;
    int cur;
    auto set_cur = [&]() {
      cur = kosuu;
      if (ooi) {
        cur++;
        ooi--;
      }
    };
    set_cur();
    vector<vector<char>> ans(r, vector<char>(c));
    int idx = 0;
    for (int i = 0; i < r; i++) {
      if (i & 1) {
        for (int j = 0; j < c; j++) {
          ans[i][j] = cs[idx];
          if (board[i][j] == 'R') {
            cur--;
            if (cur == 0) {
              set_cur();
              idx++;
              if (idx == k) idx--;
            }
          }
        }
      } else {
        for (int j = c - 1; j >= 0; j--) {
          ans[i][j] = cs[idx];
          if (board[i][j] == 'R') {
            cur--;
            if (cur == 0) {
              set_cur();
              idx++;
              if (idx == k) idx--;
            }
          }
        }
      }
    }
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        cout << ans[i][j];
      }
      cout << '\n';
    }
  }
}
