const Main = input => {
  const [ N, M ] = input.split(' ').map(e => Number(e));
  const A = [];
  const n = new Array(N).fill(0).map((e, i) => i + 1);
  const dif = new Set();

  for(let i=0; i<M; i++) {
    let j = 0;
    let cur_dif;
    
    do {
      j++;
      cur_dif = n[j] - n[0];
      //console.log(j, cur_dif, dif.has(cur_dif))
    } while(dif.has(cur_dif))

    //console.log(j, cur_dif, `${n[0]} ${n[j]}`)
    dif.add(cur_dif);
    A.push(`${n[0]} ${n[j]}`)
    n.splice(j, 1);
    n.splice(0, 1);
  }

  console.log(A.join('\n'));
};

Main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
/*Main(`4 1`);
Main(`7 3`)*/
