#include <bits/stdc++.h>
using namespace std;

void Target_Sum_SubSet(int ar[], int index, string set, int sos, int tar){
    int size = *(&ar + 1) - ar; 
    if (index == size)
    {
        /* code */
        if (sos == tar)
        {
            /* code */
            cout<<set + "."<<endl;
            return ;
        }
        
    }
    Target_Sum_SubSet(ar , index + 1 , set + (to_string)(ar[index]) + "," , sos + ar[index] , tar);
    Target_Sum_SubSet(ar , index + 1 , set , sos , tar);
}
int main(){
    int n;
    cin>>n;
    int arr[n];
    for (int i = 0; i < sizeof(arr)/sizeof(arr[0]); i++)
    {
        /* code */
        cin>>arr[i];
    }
    int target;
    cin>>target;
    Target_Sum_SubSet(arr, 0 ,"" , 0, target);
    return 0;
}