#include <bits/stdc++.h>
const double eps = 0.0000001;
using namespace std;
inline int sgn(double x) { return (x > eps) - (x < -eps); }
int f[1005][1005];
int n, m, k;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &f[i][j]);
  char c;
  int x, y;
  while (k--) {
    scanf("%s%d%d", &c, &x, &y);
    if (c == 'r') {
      for (int i = 1; i <= m; ++i) swap(f[x][i], f[y][i]);
    } else if (c == 'c') {
      for (int i = 1; i <= n; ++i) swap(f[i][x], f[i][y]);
    } else if (c == 'g') {
      printf("%d\n", f[x][y]);
    }
  }
}
