eolymp
bolt
Try our new interface for solving problems
Problems

File and worker

File and worker

You are given a text that contains data which is a sequence of no more than 105 structures.

struct worker
{
  char name[6]; // 5 bytes + 0
  char surname[6]; // 5 bytes + 0
  int age; // 10..99
  int salary; // 1000..9999
};

It is known that name and surname contsins 5 characters, 10age99, 1000salary9999.

Input

Data given in one line.

Output

In the first line print the minimum and the maximum salary. In the second line print the number of workers with minimum and maximum salary.

Time limit 1 second
Memory limit 128 MiB
Input example #1
bskwandroi591706kwyaimnsfu663051qmivnkeewq883051
Output example #1
1706 3051
1 2
Author Michael Medvediev