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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
  pr(b);
}

int ans = 0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{

  vector<int> v(5);
  rep(i, 5) cin >> v[i];
  int k;
  cin >> k;
  sort(v.begin(), v.end());
  if (v[4] - v[0] <= k)
    pr("Yay!");
  else
    pr(":(");
  return 0;
}

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

int main() {
	vector<vector<string>> data(3);
	string stra,strb,strc;
	string next = "a";
	cin >> stra;

	cin >> strb;

	cin >> strc;
	int a = 0, b = 0, c = 0;
	while (true) {
		if (next == "a") {
			if (a < stra.size()) {
				next = stra[a];
				a++;
			}
			else {
				cout << "A" << endl;
				break;
			}
		}
		else if (next == "b") {
			if (b < strb.size()) {
				next = strb[b];
				b++;
			}
			else {
				cout << "B" << endl;
				break;
			}

		}
		else {
			if (c< strc.size()) {
				next = strc[c];
				c++;
			}
			else {
				cout << "C" << endl;
				break;
			}

		}
	}

	return 0;

}