local n = io.read("*n") local a, b = {}, {} local idx = {} for i = 1, n do a[i] = io.read("*n") idx[i] = i end for i = 1, n do b[i] = io.read("*n") end table.sort(idx, function(x, y) return a[x] * b[y] > a[y] * b[x] end) print(table.concat(idx, " "))