CF159A Friends or Not

Description

Polycarpus has a hobby — he develops an unusual social network. His work is almost completed, and there is only one more module to implement — the module which determines friends. Oh yes, in this social network one won't have to add friends manually! Pairs of friends are deduced in the following way. Let's assume that user $ A $ sent user $ B $ a message at time $ t_{1} $ , and user $ B $ sent user $ A $ a message at time $ t_{2} $ . If $ 0<t_{2}-t_{1}

Input Format

The first line of the input contains two integers $ n $ and $ d $ ( $ 1

Output Format

In the first line print integer $ k $ — the number of pairs of friends. In the next $ k $ lines print pairs of friends as " $ A_{i} $ $ B_{i} $ " (without the quotes). You can print users in pairs and the pairs themselves in any order. Each pair must be printed exactly once.

Explanation/Hint

In the first sample test case Vasya and Petya are friends because their messages' sending times are one second apart. Anya and Ivan are not, because their messages' sending times differ by more than one second.