CF567A Lineland Mail
Description
All cities of Lineland are located on the $ Ox $ coordinate axis. Thus, each city is associated with its position $ x_{i} $ — a coordinate on the $ Ox $ axis. No two cities are located at a single point.
Lineland residents love to send letters to each other. A person may send a letter only if the recipient lives in another city (because if they live in the same city, then it is easier to drop in).
Strange but true, the cost of sending the letter is exactly equal to the distance between the sender's city and the recipient's city.
For each city calculate two values $ min_{i} $ and $ max_{i} $ , where $ min_{i} $ is the minimum cost of sending a letter from the $ i $ -th city to some other city, and $ max_{i} $ is the the maximum cost of sending a letter from the $ i $ -th city to some other city
Input Format
The first line of the input contains integer $ n $ ( $ 2
Output Format
Print $ n $ lines, the $ i $ -th line must contain two integers $ min_{i},max_{i} $ , separated by a space, where $ min_{i} $ is the minimum cost of sending a letter from the $ i $ -th city, and $ max_{i} $ is the maximum cost of sending a letter from the $ i $ -th city.