import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {

public static final String IN = "100 120\n"
        + "297 90\n"
        + "66 110\n"
        + "257 113\n"
        + "276 191\n"
        + "280 129\n"
        + "219 163\n"
        + "254 193\n"
        + "86 153\n"
        + "206 147\n"
        + "71 137\n"
        + "104 40\n"
        + "238 127\n"
        + "52 146\n"
        + "129 197\n"
        + "144 59\n"
        + "157 124\n"
        + "210 59\n"
        + "11 54\n"
        + "268 119\n"
        + "261 121\n"
        + "12 189\n"
        + "186 108\n"
        + "174 21\n"
        + "77 18\n"
        + "54 90\n"
        + "174 52\n"
        + "16 129\n"
        + "59 181\n"
        + "290 123\n"
        + "248 132";

public static void main(String[] args) throws IOException {

    List<int[]> input = Arrays.stream(IN.split("\n")).map(line -> line.split(" ")).map((String[] t) -> Arrays.stream(t).mapToInt(Integer::parseInt).toArray()).collect(Collectors.toList());
    
    IntStream.range(1, input.size()).filter(index -> input.get(index)[0] >= input.get(0)[0] && input.get(index)[1] <= input.get(0)[1]).sorted().forEach(num -> System.out.print(num +" "));
    }

}