find median of sorted arrays and apply diff level package structure