Uuu

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

This molecule corresponds to the graph in the sample.

Unununium (Uuu) was the name of the chemical element with atom number 111, until it changed to Röntgenium (Rg) in 2004. These heavy elements are very unstable and have only been synthesized in a few laboratories.

You have just been hired by one of these labs to optimize the algorithms used in simulations. For example, when simulating complicated chemical reactions, it is important to keep track of how many particles there are, and this is done by counting connected components in a graph.

Currently, the lab has some Python code (see attachments) that takes an undirected graph and outputs the number of connected components. As you can see, this code is based on everyone's favourite data structure union-find.

After looking at the code for a while, you notice that it actually has a bug in it!  The code still gives correct answers, but the bug could cause it to run inefficiently. Your task is to construct a graph with a given number of vertices and edges where the code runs very slowly. We will count how many times the third line (the one inside the while loop) is visited, and your program will get a score according to this number.

입력

The input consists of one line with two integers NN and MM, the number of vertices and edges your graph should have. Apart from the sample, there will be only one test case, with N=100N = 100 and M=500M = 500.

출력

The output consists of MM lines where the ii:th contains two integers u_iu\_i and v_iv\_i (1u_i,v_iN1 \leq u\_i, v\_i \leq N). This indicates that the vertices u_iu\_i and v_iv\_i are connected with an edge in your graph.

Your graph must not contain any duplicate edges or self-loops. That is, u_iu\_i must be different from v_iv\_i and all the sets u_i,v_i\\{u\_i, v\_i\\} must be distinct.

힌트

In the sample case, the output contains a graph that causes the innermost loop to be visited 2020 times. Run the code and see for yourself!