#include <iostream>

using namespace std;

int main()
{
   // freopen("in.txt","r",stdin);
    string cadena;
    cin>>cadena;
    if(cadena[0]==cadena[1]&&cadena[1]==cadena[2])
    {
        cout<<"Won"<<endl;
    }
    else
    {
        cout << "Lost" << endl;
    }
    return 0;
}

#include <iostream>
#include <string>
#include <array>
#include <algorithm>
using namespace std;

int main()
{
	string s;
	cin >> s;

	if (s.size() == 1) {
		if (s == "8") {
			cout << "Yes" << endl;
			return 0;
		}
	}

	if (s.size() == 2) {
		int si = (s[1] - '0') * 10 + s[0] - '0';
		int sj = (s[0] - '0') * 10 + s[1] - '0';
		if (si % 8 == 0 || sj % 8 == 0) {
			cout << "Yes" << endl;
			return 0;
		}
	}

	array<int, 10> count;
	count.fill(0);
	for (auto c : s) {
		++count[c - '0'];
	}

	for (int i = 112; i < 1000; i += 8) {
		array<int, 10> count2 = count;
		int k = i;
		for (int j = 0; j < 3; ++j) {
			--count2.at(k % 10);
			k /= 10;
		}

		bool ok = all_of(count2.begin(), count2.end(), [](int x) {return 0 <= x; });
		if (ok) {
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;
	return 0;
}
