The first line contains n, m, q (1≤n,m≤50, 1≤q≤300000).
Each of the next n lines contains a string of length m made only of the characters 0 and 1, describing one row of the grid. Rows are numbered from 1 top to bottom, and columns are numbered from 1 left to right.
Each of the next q lines contains one query, given as four integers a, b, c, d (1≤a≤c≤n, 1≤b≤d≤m) describing a rectangle.