!7 sclass Item { long end; S country; } static new TreeMap data; p { for (S s : lines(readerToString(utf8bufferedReader(lzmaInputStream(#1004343))))) { L l = tok_splitAtComma_unquote(s); if (l(l) < 3) continue; long start = parseLong(first(l)); long end = parseLong(second(l)); S country = intern(l.get(4)); data.put(start, nuWithValues(Item, +end, +country)); } print(l(data) + " " + first(keys(data))); botSleep(); } answer { long ip = ipToInt(trim(s)); print("s=" + s + ", ip=" + ip); Long key = data.floorKey(ip); if (key != null) { Item i = data.get(key); if (i != null) ret i.country; } }