#include <bits/stdc++.h>
using namespace std;
const int MaxN = (int)1e3 + 10;
int a[MaxN][MaxN];
int main() {
  int n, i, m, k, x, y, j;
  char c;
  scanf("%d%d%d\n", &n, &m, &k);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  scanf("\n");
  for (i = 1; i <= m; i++) a[0][i] = i;
  for (i = 1; i <= n; i++) a[i][0] = i;
  for (i = 1; i <= k; i++) {
    scanf("%c", &c);
    if (c == 'c') {
      scanf("%d%d\n", &x, &y);
      swap(a[0][x], a[0][y]);
    }
    if (c == 'r') {
      scanf("%d%d\n", &x, &y);
      swap(a[x][0], a[y][0]);
    }
    if (c == 'g') {
      scanf("%d%d\n", &x, &y);
      printf("%d\n", a[a[x][0]][a[0][y]]);
    }
  }
  cin.get();
  cin.get();
}
