#!/usr/bin/python
import sys
import re

PHRASES = [["hello", "ahoy"], ["hi", "yo-ho-ho"], ["pardon me", "avast"], 
               ["excuse me", "arrr"], ["yes", "aye"],
               ["my", "me"], ["friend", "me bucko"], ["sir", "matey"], 
               ["madam", "proud beauty"], ["miss", "comely wench"], 
               ["stranger", "scurvy dog"], ["officer", "foul blaggart"], 
	       ["toilet", "head"], ["it is", "tis"], ["it's", "tis"], ["beautiful", "strapping"],
	       ["I'm a", "I be a"], ["it will", "twill"], ["it was", "twas"],
               ["where", "whar"], ["is", "be"], ["are", "be"], ["am", "be"], 
               ["the", "th'"], ["you", "ye"], ["your", "yer"],
               ["tell", "be tellin'"], ["know", "be knowin'"],
               ["how far", "how many leagues"], ["old", "barnacle-covered"],
               ["attractive", "comely"], ["happy", "grog-filled"], ["quickly", "smartly"],
               ["nearby", "broadside"], ["restroom", "head"], ["restaurant", "galley"],
               ["hotel", "fleabag inn"], ["pub", "Skull & Scuppers"], ["mall", "market"],
               ["bank", "buried treasure"], ["die", "visit Davey Jones' Locker"],
               ["died", "visited Davey Jones' Locker"], ["kill", "keel-haul"],
               ["killed", "keel-hauled"], ["sleep", "take a caulk"],
               ["stupid", "addled"], ["after", "aft"], ["stop", "belay"],
               ["nonsense", "bilge"], ["officer", "bosun"], ["ocean", "briny deep"],
               ["song", "shanty"], ["money", "doubloons"], ["food", "grub"],
               ["nose", "prow"], ["leave", "weigh anchor"], ["cheat", "hornswaggle"],
               ["forward", "fore"], ["child", "sprog"], ["children", "sprogs"],
               ["sailor", "swab"], ["lean", "careen"], ["find", "come across"],
               ["mother", "dear ol' mum, bless her black soul"],
               ["drink", "barrel o' rum"], ["of", "o'"]
              ]
 
               
def piratize(str):
        for phrase in PHRASES:
                out_phrase = phrase[1]
		regstr = phrase[0].join (("\\b", "\\b"))
		reg = re.compile(regstr, re.I)
                def repl_it(matchobj):
                        if matchobj.group(0)[0] >= "A" and matchobj.group(0)[0] <= "Z":
                                return out_phrase.capitalize()
                        else:
                                return out_phrase
        	str = reg.sub(repl_it, str)
        return str

print piratize(sys.argv[1])
