Quadruplet Sum

medium
1. You are given an array(arr) of N integers and an integer X.
2. You have to find all unique quadruplets(a,b,c,d) which satisfies this condition - 
   a+b+c+d = X.

Input Format

A number N arr1 arr2.. N numbers A number X

Output Format

Every line of output contains four integers which represent a quadruplet having sum X.

Constraints

1 <= N <= 200
-10^3 <= arr[i] <= 10^3
-10^9 <= X <= 10^9

Example

Input
6
1 0 -1 0 -2 2
0
Output
-2 -1 1 2 
-2 0 0 2 
-1 0 0 1 
Previous
Pairs With Given Sum In Two Sorted Matrices
Next
Quadruplet Sum - 2

Related Questions