#include <iostream>
#include <vector>
#include <unordered_map>
#include <stdio.h>

using namespace std;

int main() 
{
    int i=0;
    int j=0;
    int a=0;
    vector <int> b;
    unordered_map<int,int>hash;
    while(cin>>a)
    {
        if(getchar()==',')
        {
            break;
        }
        b.push_back(a);
        if(hash.count(a)==0)
        {
            hash[a]=1;
        }
        else 
        {
            hash[a]++;
        }
    }
    int n=0;
    int len=b.size();
    cin>>n;
    int count2=0;
    for(i=0;i<len-1;i++)
    {
        for(j=i+1;j<len;j++)
        {
            int x=n-b[i]-b[j];
            if(hash.count(x)  &&  hash[x]>0)
            {
                cout<<"True";
                count2++;
                break;
            }
        }
        if(count2)
        {
            break;
        }
    }
    if(count2==0)
    {
        cout<<"False";
    }
    return 0;
}