#include <bits/stdc++.h>
using namespace std;
  
#define dump(...) cout<<"# "<<#__VA_ARGS__<<'='<<(__VA_ARGS__)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
  
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;
  
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
    return os<<'('<<p.first<<','<<p.second<<')';
}
  
template<typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
    print_tuple<Cdr...>(os,t);
    os<<(sizeof...(Cdr)?",":"")<<get<sizeof...(Cdr)>(t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
    print_tuple<Args...>(os<<'(',t);
    return os<<')';
}
  
template<typename Ch,typename Tr,typename C>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
    os<<'[';
    for(auto i=begin(c);i!=end(c);++i)
        os<<(i==begin(c)?"":" ")<<*i;
    return os<<']';
}
  
constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;
  
template<typename C>
void RadixSort(const vi& src,vi& dst,const C& s,int ofs,int n,int asize)
{
    vi hist(asize+1);
    rep(i,n) hist[s[ofs+src[i]]]++;
    rep(i,asize) hist[i+1]+=hist[i];
    per(i,n) dst[--hist[s[ofs+src[i]]]]=src[i];
}
  
bool Less(int a1,int a2,int b1,int b2)
{
    return a1!=b1?a1<b1:a2<b2;
}
bool Less(int a1,int a2,int a3,int b1,int b2,int b3)
{
    return a1!=b1?a1<b1:Less(a2,a3,b2,b3);
}
  
// s[0..n-1]: 入力文字列．末尾に'\0'が3つ必要(s[n]=s[n+1]=s[n+2]=0)．
// sa[0..n-1]: 接尾辞配列．
// asize: アルファベットサイズ，s[i] \in [1,asize]
template<typename C>
void KaerkkaeinenSanders(const C& s,vi& sa,int asize)
{
    int n=sa.size();
    int n0=(n+2)/3,n1=(n+1)/3,n2=n/3,n02=n0+n2;
    vi s12(n02+3),sa12(n02);
      
    for(int i=0,j=0;i<n+(n0-n1);i++)
        if(i%3) s12[j++]=i;
    RadixSort(s12,sa12,s,2,n02,asize);
    RadixSort(sa12,s12,s,1,n02,asize);
    RadixSort(s12,sa12,s,0,n02,asize);
      
    int name=0,x=-1,y=-1,z=-1;
    rep(i,n02){
        int j=sa12[i];
        if(s[j]!=x || s[j+1]!=y || s[j+2]!=z)
            x=s[j],y=s[j+1],z=s[j+2],name++;
        if(j%3==1) s12[j/3]=name;
        else       s12[n0+j/3]=name;
    }
      
    if(name==n02) // unique
        rep(i,n02) sa12[s12[i]-1]=i;
    else{
        KaerkkaeinenSanders(s12,sa12,name);
        rep(i,n02) s12[sa12[i]]=i+1;
    }
      
    vi s0(n0),sa0(n0);
    for(int i=0,j=0;i<n02;i++)
        if(sa12[i]<n0) s0[j++]=3*sa12[i];
    RadixSort(s0,sa0,s,0,n0,asize);
      
    int i=0,j=n0-n1,k=0;
    while(i<n0 && j<n02){
        int p=sa0[i],q=sa12[j]<n0?sa12[j]*3+1:(sa12[j]-n0)*3+2;
        if(sa12[j]<n0?
            Less(s[p],s12[p/3],s[q],s12[n0+sa12[j]]):
            Less(s[p],s[p+1],s12[n0+p/3],s[q],s[q+1],s12[sa12[j]+1-n0]))
            sa[k++]=p,i++;
        else
            sa[k++]=q,j++;
    }
    for(;i<n0;k++,i++)
        sa[k]=sa0[i];
    for(;j<n02;k++,j++)
        sa[k]=sa12[j]<n0?sa12[j]*3+1:(sa12[j]-n0)*3+2;
}
void KaerkkaeinenSanders(const string& s,vi& sa)
{
    KaerkkaeinenSanders<string>(s+string(3,0),sa,127);
}
void KaerkkaeinenSanders(const char* s,vi& sa)
{
    KaerkkaeinenSanders<string>(s+string(3,0),sa,127);
}
  
// s[0..n-1] (s[n]=0), sa[0..n-1]
// lcp[0..n-1] (lcp[i]:s[sa[i-1]..]とs[sa[i]..]のLCP.lcp[0]=0)
template<typename C>
void LCP(const C& s,const vi& sa,vi& lcp)
{
    int n=sa.size();
    vi rank(n);
    rep(i,n) rank[sa[i]]=i;
    for(int i=0,h=0;i<n;i++){
        if(h>0) h--;
        if(rank[i]>0)
            for(int j=sa[rank[i]-1];;h++)
                if(s[j+h]!=s[i+h]) break;
        lcp[rank[i]]=h;
    }
}
  
int NextPow2(int x)
{
    x--;
    for(int i=1;i<32;i*=2) x|=x>>i;
    return x+1;
}
const int I=INF;
int F(int a,int b){return min(a,b);}
  
struct SegmentTree{
    int size;
    vi data;
    SegmentTree(int n):size(NextPow2(n)),data(size*2,I){}
    SegmentTree(const vi& a):size(NextPow2(a.size())),data(size*2,I){
        copy(all(a),begin(data)+size);
        peri(i,1,size) data[i]=F(data[i*2],data[i*2+1]);
    }
    int Get(int i){
        return data[size+i];
    }
    void Update(int i,int x){
        data[size+i]=x;
        for(i+=size;i/=2;) data[i]=F(data[i*2],data[i*2+1]);
    }
    int Query(int a,int b,int i,int l,int r){
        if(b<=l || r<=a) return I;
        if(a<=l && r<=b) return data[i];
        return F(Query(a,b,i*2,l,(l+r)/2),Query(a,b,i*2+1,(l+r)/2,r));
    }
    int Query(int a,int b){
        return Query(a,b,1,0,size);
    }
};
  
int main()
{
    for(string s;getline(cin,s) && s!="#";){
        int n=s.size();
        vi sa(n),lcp(n);
        KaerkkaeinenSanders(s,sa);
        LCP(s,sa,lcp);
          
        vi rank(n);
        rep(i,n) rank[sa[i]]=i;
          
        SegmentTree st(lcp);
        string res;
        for(int i=1;i<=n;i++){
            int alen=n-2*i,blen=i-alen;
            if(alen<=0 || blen<=0) continue;
            int a1=0,a2=i,a3=2*i;
            int b1=alen,b2=alen+i;
            vi ra={rank[0],rank[i],rank[2*i]}; sort(all(ra));
            vi rb={rank[alen],rank[alen+i]}; sort(all(rb));
            if(st.Query(ra[0]+1,ra[1]+1)>=alen && st.Query(ra[1]+1,ra[2]+1)>=alen && st.Query(rb[0]+1,rb[1]+1)>=blen){
                res=s.substr(0,i);
                break;
            }
        }
        if(res.empty())
            cout<<"mitomerarenaiWA"<<endl;
        else
            cout<<"Love "<<res<<"!"<<endl;
    }
}

Measured memory_bytes: 26540