import java.util.*; import java.awt.geom.*; public class pool { static Point2D.Double cue; static Point2D.Double tar; static Point2D.Double[] other; public static void main(String[] args) { Scanner s = new Scanner(System.in); while (true) { double xc = s.nextDouble(); if (xc == 0) break; double yc = s.nextDouble(); double xt = s.nextDouble(); double yt = s.nextDouble(); cue = new Point2D.Double(xc, yc); tar = new Point2D.Double(xt, yt); other = new Point2D.Double[s.nextInt()]; for (int i = 0; i < other.length; i++) { other[i] = new Point2D.Double(s.nextDouble(), s.nextDouble()); } ArrayList answer = new ArrayList(); if (isPossible(new Point2D.Double(0, 0))) answer.add(1); if (isPossible(new Point2D.Double(54, 0))) answer.add(2); if (isPossible(new Point2D.Double(108, 0))) answer.add(3); if (isPossible(new Point2D.Double(0, 54))) answer.add(4); if (isPossible(new Point2D.Double(54, 54))) answer.add(5); if (isPossible(new Point2D.Double(108, 54))) answer.add(6); if (answer.size() == 0) System.out.println("no shot"); else { for (int i = 0; i < answer.size(); i++) { if (i > 0) System.out.print(" "); System.out.print(answer.get(i)); } System.out.println(); } } } public static boolean isPossible(Point2D.Double hole) { Line2D.Double tarLine = new Line2D.Double(tar, hole); double tarTheta = Math.atan2(hole.y - tar.y, hole.x - tar.x); Point2D.Double tan = new Point2D.Double(tar.x - 2 * Math.cos(tarTheta), tar.y - 2 * Math.sin(tarTheta)); Line2D.Double cueLine = new Line2D.Double(cue, tan); double cueTheta = Math.atan2(cue.y - tan.y, cue.x - tan.x); double dt = cueTheta - tarTheta; if (dt >= Math.PI) dt -= 2 * Math.PI; if (dt <= -Math.PI) dt += 2 * Math.PI; if (Math.abs(dt) < Math.PI / 2) return false; for (Point2D.Double o : other) { if (tarLine.ptSegDist(o) < 2) return false; if (cueLine.ptSegDist(o) < 2) return false; } return true; } }