import java.io.*; /** * A wrong solution for Assessment Disruption. * This is an otherwise correct solution which does not care about the maximum word count. */ public class assessment_mb_wordcountbug { public static void main(String[] args) throws IOException { try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out)) { String test = in.readLine(); int wsIndex = test.indexOf(' '); int n = Integer.parseInt(test.substring(0, wsIndex)); int wordCount = Integer.parseInt(test.substring(wsIndex + 1)); int v = n / 3; int w = n - v; for (int i = 0; i < n; ++i) { int x = i < w ? v + i : n - 1 - i; int y = i < w ? n - v - 1 - i : 0; out.println((wordCount + x) + " " + (n - y)); } } } }