The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. 

UCDHP stores some secret information about meteors as an *n* × *m* table with integers in its cells. The order of meteors in the Universe is changing. That's why the main UCDHP module receives the following queries:
 -  The query to swap two table rows; -  The query to swap two table columns; -  The query to obtain a secret number in a particular table cell. 
As the main UCDHP module is critical, writing the functional of working with the table has been commissioned to you.
The first line contains three space-separated integers *n*, *m* and *k* (1 ≤ *n*, *m* ≤ 1000, 1 ≤ *k* ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly.

Next *n* lines contain *m* space-separated numbers each — the initial state of the table. Each number *p* in the table is an integer and satisfies the inequality 0 ≤ *p* ≤ 10<sup class="upper-index">6</sup>.

Next *k* lines contain queries in the format "*s*<sub class="lower-index">*i*</sub> *x*<sub class="lower-index">*i*</sub> *y*<sub class="lower-index">*i*</sub>", where *s*<sub class="lower-index">*i*</sub> is one of the characters "с", "r" or "g", and *x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub> are two integers.
 -  If *s*<sub class="lower-index">*i*</sub> = "c", then the current query is the query to swap columns with indexes *x*<sub class="lower-index">*i*</sub> and *y*<sub class="lower-index">*i*</sub> (1 ≤ *x*, *y* ≤ *m*, *x* ≠ *y*); -  If *s*<sub class="lower-index">*i*</sub> = "r", then the current query is the query to swap rows with indexes *x*<sub class="lower-index">*i*</sub> and *y*<sub class="lower-index">*i*</sub> (1 ≤ *x*, *y* ≤ *n*, *x* ≠ *y*); -  If *s*<sub class="lower-index">*i*</sub> = "g", then the current query is the query to obtain the number that located in the *x*<sub class="lower-index">*i*</sub>-th row and in the *y*<sub class="lower-index">*i*</sub>-th column (1 ≤ *x* ≤ *n*, 1 ≤ *y* ≤ *m*). 
The table rows are considered to be indexed from top to bottom from 1 to *n*, and the table columns — from left to right from 1 to *m*.
# My code :  messy 
# def cosmicTables(n,m,k,li1,li2):
# 	for i in range(k):
		
# 		if li2[i][0] == 'c':
# 			for j in range(n):
# 				li1[j][int(li2[i][1])-1],li1[j][int(li2[i][2])-1] = li1[j][int(li2[i][2])-1],li1[j][int(li2[i][1])-1]
# 			# print(li2)
# 		elif li2[i][0] == "r":
# 			for j in range(m):
# 				li1[int(li2[i][1])-1][j],li1[int(li2[i][2])-1][j] =li1[int(li2[i][2])-1][j],li1[int(li2[i][1])-1][j]
# 			# print(li1)

# 		elif li2[i][0] == "g":
# 			print(li1[int(li2[i][1])-1][int(li2[i][2])-1])



# n,m,k = input().split()

# li1=[]
# for i in range(int(n)):
# 	a=[x for x in input().split()]
# 	li1.append(a)
# # print(li1)
# li2=[]
# for i in range(int(k)):
# 	a=[x for x in input().split()]
# 	li2.append(a)
# # print(li2)

# cosmicTables(int(n),int(m),int(k),li1,li2)



# Keida's code : optimised 
# def cosmic_tables(array,s,x,y):
#     if s=="r":
#         array[x-1],array[y-1]=array[y-1],array[x-1]
#         return array
#     elif s=="c":
#         for i in range(len(array)):
#             array[i][x-1],array[i][y-1]=array[i][y-1],array[i][x-1]
#         return array
#     else:
#         print(array[x-1][y-1])
#         return array


# array=[]
# n,m,k=input().split()
# for i in range(int(n)):
#     array.append([int(x) for x in input().split()])
# for i in range(int(k)):
#     s,x,y=input().split()
#     array=cosmic_tables(array,s,int(x),int(y))
            

# real code : ultra optimised 

table = []
n, m, k = map(int, input().split())
[table.append(input().split()) for i in range(n)]
rs, cs = [i for i in range(n)], [i for i in range(m)]
for i in range(k):
    s, x, y = input().split()
    x, y = int(x) - 1, int(y) - 1
    if s == "c":
        cs[x], cs[y] = cs[y], cs[x]
    elif s == "r":
        rs[x], rs[y] = rs[y], rs[x]
    else:
        print(table[rs[x]][cs[y]])



# #include <cstdio>
# #include <algorithm>

# using namespace std;

# int p[1001][1001], row[1001], col[1001];

# int main()
# {
#     int n, m, k;
#     scanf("%d%d%d", &n, &m, &k);

#     for (int r = 1; r <= n; ++r)
#         row[r] = r;

#     for (int c = 1; c <= m; ++c)
#         col[c] = c;

#     for (int r = 1; r <= n; ++r)
#         for (int c = 1; c <= m; ++c)
#             scanf("%d", &p[r][c]);

#     while (k--)
#     {
#         char s[2];
#         int x, y;
#         scanf("%s%d%d", s, &x, &y);
#         switch (s[0])
#         {
#         case 'r':
#             swap(row[x], row[y]);
#             break;
#         case 'c':
#             swap(col[x], col[y]);
#             break;
#         case 'g':
#             printf("%d\n", p[row[x]][col[y]]);
#             break;
#         default:
#             break;
#         }
#     }
#     return 0;
# }

