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*.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace fils
{
    class Program
    {
        static void Main(string[] args)
        {
            int m;
            int n;
            int k;
            string[] s = Console.ReadLine().Split(' ');
            n = int.Parse(s[0]);
            m = int.Parse(s[1]);
            k = int.Parse(s[2]);
            
            int[,] matrix = new int[n, m];
            for (int i = 0; i < n; i++ )
            {
                string[] ss = Console.ReadLine().Split(' ');
                for (int j = 0; j < m; j++)
                {
                    matrix[i, j] = int.Parse(ss[j]);
                }
            }

            int[] permRows = new int[n];
            int[] permCols = new int[m];

            for (int i = 0; i < n; i++ )
            {
                permRows[i] = i;
            }

            for (int i = 0; i < m; i++)
            {
                permCols[i] = i;
            }

            StringBuilder r = new StringBuilder();
            for (int i = 0; i < k; i++)
            {
                string[] ss = Console.ReadLine().Split(' ');

                int x = int.Parse(ss[1])-1;
                int y = int.Parse(ss[2])-1;

                if (ss[0] == "c") 
                {
                    int temp = permCols[x];
                    permCols[x] = permCols[y];
                    permCols[y] = temp;
                }

                if (ss[0] == "r")
                {
                    int temp = permRows[x];
                    permRows[x] = permRows[y];
                    permRows[y] = temp;
                }

                if (ss[0] == "g")
                {
                    string res = matrix[permRows[x], permCols[y]].ToString();
                    r.Append(res);
                    r.Append("\n");
                }
            }

            Console.WriteLine(r);


        }
    }
}
