#include "bits/stdc++.h"
using namespace std;
#define max(a, b) (a < b ? b : a)
#define min(a, b) ((a > b) ? b : a)
#define mod 1e9 + 7
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define FORL(a, b, c) for (int(a) = (b); (a) <= (c); (a)++)
#define FORR(a, b, c) for (int(a) = (b); (a) >= (c); (a)--)
#define INF 1000000000000000003
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define F first
#define S second
#define PB push_back
#define POB pop_back
#define MP make_pair

void solve(){
    string s,t;
    cin>>s>>t;
    if((s=="beachball" && t=="watermelon") || (s=="watermelon" && t=="beachball")){
        cout<<"shrinebell"<<endl;
    }
    else if((s=="watermelon" && t=="shrinebell") ||(s=="shrinebell" && t=="watermelon")){
        cout<<"beachball"<<endl;
    }
    
    else{
        cout<<"watermelon"<<endl;
    }
    }
    int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    int T=1;
    // cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}