Good Dish#11841

Good Dish

1 second
256 megabytes
Medium

Cat Kvanta really likes four ingredients: chicken, veal, salmon, and cheese. She considers a dish good if it consists of three components: two distinct ones chosen from chicken, veal, and salmon, and one portion of cheese. Help Kvanta determine the maximum number of good dishes she can prepare and the sum of portions that will remain unused after preparing these dishes, given portions of chicken, portions of veal, portions of salmon, and portions of cheese.

Input

A single line contains four integers a, b, c, d (0 \le a, b, c, d \le 10^{9}).

Output

Print two integers separated by a space: the maximum number of good dishes Kvanta can prepare, and the sum of remaining portions of ingredients after preparing them.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

  • In the first example, one can prepare, for instance, 2 dishes from {chicken, veal, cheese} and {salmon, chicken, cheese}.

  • In the second example, one can prepare, for instance, 3 dishes from {chicken, veal, cheese} and 2 dishes from {veal, salmon, cheese}.