import sequtils, strutils var n, w: int (n, w) = stdin.readLine.split.map parseInt var xs = n.newSeqWith stdin.readLine.split.map parseInt xs.keepItIf it[1] <= w if xs.len == 0: echo -1 quit() echo max xs.mapIt it[0]