#include <iostream>
#include <vector>
using namespace std;
// 3 sum problems
class Solution {
public:
    vector<vector<int>> threeSum(vector<int>& nums) {
 // create a vector which stores the index of the elements which forms the sum equal to zero
        vector<vector<int>> res;
        
        // Run the loop for the given equation 
        // create a function which stores the 
        for(int l=0;l<nums.size()-2;l++){
        	// Run the another loop for the given problems
        	for(int m=l+1;m<nums.size();m++){
        		// Run another loop for the given problems
        		for(int n=m+1;n<nums.size();n++){
        		//	cout<<"l: "<< l <<" m: "<< m <<" n: "<< n<<endl;
        	     	if(l!=m && l!=n && m!=n){
        				int sum=nums[l]+nums[m]+nums[n];
        				if(sum==0){
        					vector<int> v;
        					v.push_back(nums[l]);
        					v.push_back(nums[m]);
        					v.push_back(nums[n]);
        					res.push_back(v);
        				
        				}
        				
        				
        			}
        		}
        	}
        }
        return res;
    }
};
int main() {
	// your code goes here
	return 0;
}