Problem: Saving electricity is very important!

You are in the office represented as R \times C grid that consists of walls and rooms. It is guaranteed that, for any pair of rooms in the office, there exists exactly one route between the two rooms. It takes 1 unit of time for you to move to the next room (that is, the grid adjacent to the current room). Rooms are so dark that you need to switch on a light when you enter a room. When you leave the room, you can either leave the light on, or of course you can switch off the light. Each room keeps consuming electric power while the light is on.

Today you have a lot of tasks across the office. Tasks are given as a list of coordinates, and they need to be done in the specified order. To save electricity, you want to finish all the tasks with the minimal amount of electric power.

The problem is not so easy though, because you will consume electricity not only when light is on, but also when you switch on/off the light. Luckily, you know the cost of power consumption per unit time and also the cost to switch on/off the light for all the rooms in the office. Besides, you are so smart that you don't need any time to do the tasks themselves. So please figure out the optimal strategy to minimize the amount of electric power consumed.

After you finished all the tasks, please DO NOT leave the light on at any room. It's obviously wasting!



Input

The first line of the input contains three positive integers R (0 \lt R \leq 50), C (0 \lt C \leq 50) and M (2 \leq M \leq 1000). The following R lines, which contain C characters each, describe the layout of the office. '.' describes a room and '#' describes a wall.

This is followed by three matrices with R rows, C columns each. Every elements of the matrices are positive integers. The (r, c) element in the first matrix describes the power consumption per unit of time for the room at the coordinate (r, c). The (r, c) element in the second matrix and the third matrix describe the cost to turn on the light and the cost to turn off the light, respectively, in the room at the coordinate (r, c).

Each of the last M lines contains two positive integers, which describe the coodinates of the room for you to do the task.

Note that you cannot do the i-th task if any of the j-th task (0 \leq j \leq i) is left undone.

Output

Print one integer that describes the minimal amount of electric power consumed when you finished all the tasks.

Examples

Input

1 3 2
...
1 1 1
1 2 1
1 1 1
0 0
0 2


Output

7


Input

3 3 5
...
.##
..#
1 1 1
1 0 0
1 1 0
3 3 3
3 0 0
3 3 0
5 4 5
4 0 0
5 4 0
1 0
2 1
0 2
2 0
0 0


Output

77


Input

5 5 10
.###
....
.#
..#.#
....
0 12 0 0 0
0 4 3 2 10
0 0 0 99 0
11 13 0 2 0
0 1 1 2 1
0 4 0 0 0
0 13 8 2 4
0 0 0 16 0
1 1 0 2 0
0 2 3 1 99
0 2 0 0 0
0 12 2 12 2
0 0 0 3 0
4 14 0 16 0
0 2 14 2 90
0 1
3 0
4 4
1 4
1 1
4 4
1 1
4 3
3 0
1 4


Output

777

Solution (in CPP):

Solution:
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
typedef pair<int, int> P;

int main(){
  int H, W, M;
  while(cin>>H>>W>>M){
    vector<string> grid(H);
    REP(i, H) cin>>grid[i];
    int c_mt[50][50];
    int c_on[50][50];
    int c_of[50][50];
    REP(y, H)REP(x, W) cin>>c_mt[y][x];
    REP(y, H)REP(x, W) cin>>c_on[y][x];
    REP(y, H)REP(x, W) cin>>c_of[y][x];
    vector<int> cx, cy;
    REP(i, M){
      int y, x; cin>>y>>x;
      cx.push_back(x); cy.push_back(y);
    }
    vector<int> time[50][50];
    time[cy[0]][cx[0]].push_back(0);
    int now = 0;
    REP(i, M - 1){
      const P null = P(-1, -1);
      P prev[50][50];
      REP(y, H)REP(x, W) prev[y][x] = null;
      queue<int> qx, qy;
      qx.push(cx[i]); qy.push(cy[i]);
      while(!qx.empty()){
        int x = qx.front(); qx.pop();
        int y = qy.front(); qy.pop();
        REP(r, 4){
          int nx = x + dx[r];
          int ny = y + dy[r];
          if(valid(nx, ny, W, H) && prev[ny][nx] == null && grid[ny][nx] != '#'){
            prev[ny][nx] = P(x, y);
            qx.push(nx); qy.push(ny);
          }
        }
      }
      prev[cy[i]][cx[i]] = null;
      vector<P> path;
      P cur = P(cx[i + 1], cy[i + 1]);
      while(cur != null){
        path.push_back(cur);
        cur = prev[cur.second][cur.first];
      }
      reverse(path.begin(), path.end());
      FOR(i, 1, path.size()){
        int x = path[i].first, y = path[i].second;
        int t = now + i;
        time[y][x].push_back(t);
      }
      now += path.size() - 1;
    }
    ll ans = 0;
    REP(y, H)REP(x, W){
      if(time[y][x].empty()) continue;
      int T = time[y][x].size();
      ll dp[1010][2] = {};
      REP(i, T) dp[i][0] = dp[i][1] = (ll)1e16;
      dp[0][0] = c_on[y][x] + c_of[y][x];
      dp[0][1] = c_on[y][x];
      FOR(i, 1, T){
        int cur = min(dp[i - 1][0] + c_on[y][x], dp[i - 1][1] + (ll)c_mt[y][x] * (time[y][x][i] - time[y][x][i - 1]));
        dp[i][0] = cur + c_of[y][x];
        dp[i][1] = cur;
      }
      //printf("x = %d y = %d m = %lld\n", x, y, dp[T-1][0]);
      ans += dp[T - 1][0];
    }
    cout<<ans<<endl;
  }
  return 0;
}