well here you go, but next time try something by yourself first, then ask for help. (I did it fast so excuse me for the messy look)
NOTE: I assumed that the input is clear and good, which means I didn't check if the variables wether the user entered really int or char... check them by yourself if you want.
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char** arr;
int n,m;
int i,j,pairs,r,c;
//input rows and columns
scanf("%d", &n);
scanf("%d", &m);
//define matrix
arr=(char**)malloc(n*sizeof(char*));
for(i=0; i<n; i++)
arr[i]=(char*)malloc(m*sizeof(char));
//input matrix
for(i=0;i<n;i++)
for(j=0;j<m;j++)
scanf(" %c", &arr[i][j]);
//input number of pairs, and print them...
scanf("%d", &pairs);
while(pairs!=0)
{
scanf("%d", &r);
scanf("%d", &c);
printf("%c", arr[r-1][c-1]);
pairs--;
}
printf("\n");
//free memory
for(i=0;i<n;i++)
free(arr[i]);
free(arr);
return 0;
}
hope it helped