import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;

/**
 *
 * @author sorin
 */
public class prog {

    public static void main(String[] args) throws FileNotFoundException {
        File homedir = new File(System.getProperty("user.home"));

        // Scanner scanner = new Scanner(new File(homedir, "/Downloads/A-large.in"));
        Scanner scanner = new Scanner(System.in);
        int radius = Integer.parseInt(scanner.nextLine());
        Set<Point> set = new HashSet<>();
        Point p = new Point(-1 * (radius - 1), -1 * (radius - 1));
        addPoints(set, p);

        System.out.println((-1 * (radius - 1)) + " " + (-1 * (radius - 1)));

        while (true) {
            String[] line = scanner.nextLine().split(" ");
            p = new Point(Integer.parseInt(line[0]), Integer.parseInt(line[1]));
            addPoints(set, p);
            p = findNextNumber(radius, set);
            if (p == null) {
                break;
            }
            addPoints(set, p);
            System.out.println(p.x + " " + p.y);
        }
    }

    private static void addPoints(Set<Point> set, Point p) {
        set.add(new Point(p.x - 1, p.y - 1));
        set.add(new Point(p.x - 1, p.y + 0));
        set.add(new Point(p.x - 1, p.y + 1));

        set.add(new Point(p.x, p.y - 1));
        set.add(new Point(p.x, p.y + 0));
        set.add(new Point(p.x, p.y + 1));

        set.add(new Point(p.x + 1, p.y - 1));
        set.add(new Point(p.x + 1, p.y + 0));
        set.add(new Point(p.x + 1, p.y + 1));
        //set.add(new Point(p.x + 1, p.y));
    }

    private static Point findNextNumber(int radius, Set<Point> set) {
        for (int i = -(1 * (radius - 1)); i < radius; i++) {
            for (int j = -(1 * (radius - 1)); j < radius; j++) {
                Point p = new Point(i, j);
                if (!set.contains(p)) {
                    return p;
                }
            }
        }
        return null;
    }

    private static class Point {

        int x;
        int y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object obj) {
            Point p1 = (Point) obj;
            if ((p1.x == this.x) && (p1.y == this.y)) return true;
            return false;
        }

        @Override
        public int hashCode() {
            return x * 1000 + y; 
        }
        
        

    }
}