class Solution {
public int solution(int[][] sizes) {
int wmax = 0;
int hmax = 0;
for (int size[] : sizes) {
wmax = Math.max (wmax, Math.max(size[0], size[1]));
hmax = Math.max (hmax, Math.min(size[0], size[1]));
}
return wmax*hmax;
}
}