import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
void answer(int count)
{
}
/**
* @param H ホーム画面縦の区画数
* @param W ホーム画面横の区画数
* @param array[Y][X] ホーム画面の配置
* @param S ウィジェットの縦サイズ
* @param T ウィジェットの横サイズ
*/
void resolve(int H, int W, int[][] array, int S, int T)
{
// your code goes here
}
{
Main instance = new Main();
String[] hw
= in.
readLine().
split(" "); final int H
= Integer.
parseInt(hw
[0]); // ホーム画面縦の区画数 final int W
= Integer.
parseInt(hw
[1]); // ホーム画面横の区画数
int[][] home = new int[H][W];
for (int y = 0; y < H; y++)
{
for (int x = 0; x < W; x++)
{
home[y][x] = (int)(line.charAt(x) - '0');
}
}
final int N
= Integer.
parseInt(in.
readLine());
for (int i = 0; i < N; i++)
{
String[] st
= in.
readLine().
split(" "); int s
= Integer.
parseInt(st
[0]); // ウィジェットの縦サイズ int t
= Integer.
parseInt(st
[1]); // ウィジェットの横サイズ
instance.resolve(H, W, home, s, t);
}
}
}
CmltcG9ydCBqYXZhLnV0aWwuKjsKaW1wb3J0IGphdmEubGFuZy4qOwppbXBvcnQgamF2YS5pby4qOwoKY2xhc3MgTWFpbgp7Cgl2b2lkIGFuc3dlcihpbnQgY291bnQpCgl7CgkJU3lzdGVtLm91dC5wcmludGxuKGNvdW50KTsKCX0KCQoJLyoqCgkgKiBAcGFyYW0gSCAgICAgICAgICAgIOODm+ODvOODoOeUu+mdoue4puOBruWMuueUu+aVsAoJICogQHBhcmFtIFcgICAgICAgICAgICDjg5vjg7zjg6DnlLvpnaLmqKrjga7ljLrnlLvmlbAKCSAqIEBwYXJhbSBhcnJheVtZXVtYXSAg44Ob44O844Og55S76Z2i44Gu6YWN572uCgkgKiBAcGFyYW0gUyAgICAgICAgICAgIOOCpuOCo+OCuOOCp+ODg+ODiOOBrue4puOCteOCpOOCugoJICogQHBhcmFtIFQgICAgICAgICAgICDjgqbjgqPjgrjjgqfjg4Pjg4jjga7mqKrjgrXjgqTjgroKCSAqLwoJdm9pZCByZ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