import re

# Sample text
text = input()

# Tokenization (Split text into words)
def tokenize(text):
    words = re.findall(r'\b\w+\b', text.lower())
    return words

# Custom stopwords list (including the additional stop words)
stop_words = set([
    #Vesion 0.1.0
    "a", "about", "above", "after", "again", "against", "ain't", "all", "am", "an", "and", "any", "are", "aren't",
    "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can", "can't",
    "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "during",
    "each", "few", "for", "from", "further", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he",
    "he'd", "he'll", "he's", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's", "i",
    "i'd", "i'll", "i'm", "i've", "if", "in", "into", "is", "isn't", "it", "it's", "its", "itself", "let's", "me",
    "more", "most", "mustn't", "my", "myself", "no", "nor", "not", "of", "off", "on", "once", "only", "or", "other",
    "ought", "our", "ours", "ourselves", "out", "over", "own", "same", "shan't", "she", "she'd", "she'll", "she's",
    "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them",
    "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this",
    "those", "through", "to", "too", "under", "until", "up", "very", "was", "wasn't", "we", "we'd", "we'll", "we're",
    "we've", "were", "weren't", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who",
    "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're",
    "you've", "your", "yours", "yourself", "yourselves", "alone", "along", "already", "also", "although", "always",
    "am", "among", "amongst", "amount", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anyway",
    "anywhere", "are", "around", "as", "at", "back", "be", "became", "because", "become", "becomes", "becoming",
    "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both",
    "bottom", "but", "by", "can", "can't", "cannot", "cant", "co", "con", "could", "couldn't", "de", "describe",
    "detail", "do", "done", "down", "due", "during", "each", "eg", "eight", "either", "eleven", "else", "elsewhere",
    "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few",
    "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former", "formerly", "forty", "found", "four",
    "from", "front", "full", "further", "get", "give", "go", "had", "has", "hasnt", "have", "he", "hence", "her", "here",
    "hereafter", "hereby", "herein", "hereupon", "hers", "herself", "him", "himself", "his", "how", "however", "hundred",
    "ie", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "its", "itse", "keep", "last", "latter",
    "latterly", "least", "less", "ltd", "made", "many", "may", "me", "meanwhile", "might", "mill", "mine", "moreover",
    "more", "most", "mostly", "move", "much", "must", "my", "myself", "name", "namely", "neither", "never", "nevertheless",
    "next", "nine", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often",
    "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over",
    "own", "part", "per", "perhaps", "please", "put", "rather", "re", "same", "see", "seem", "seemed", "seeming", "seems",
    "serious", "several", "she", "should", "show", "side", "since", "sincere", "six", "sixty", "so", "some", "somehow",
    "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system", "take", "ten", "than",
    "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefore",
    "therein", "thereupon", "these", "they", "thick", "thin", "third", "this", "those", "though", "three", "through",
    "throughout", "thru", "thus", "to", "together", "too", "top", "toward", "towards", "twelve", "twenty", "two", "un",
    "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "when", "whence",
    "whenever", "where", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which",
    "while", "whither", "who", "whoever", "whole", "whom", "whose", "why", "will", "with", "within", "without", "would",
    "yet", "you", "your", "yours", "yourself", "yourselves", "even", "ever", "every", "for", "from", "go", "had", "has",
    "have", "he", "her", "here", "him", "his", "how", "I", "if", "in", "is", "it" ,
    #Version 0.1.1  
    "let", "like", "likely", "may", "me", "might", "more", "moreover", "most", "mostly", "much", "must", "my", "myself",
    "name", "namely", "neither", "never", "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "not",
    "nothing", "now", "nowhere", "of", "off", "often", "on", "once", "one", "only", "onto", "or", "other", "others",
    "otherwise", "our", "ours", "ourselves", "out", "over", "own", "part", "per", "perhaps", "please", "put", "rather",
    "re", "same", "see", "seem", "seemed", "seeming", "seems", "serious", "several", "she", "should", "show", "side",
    "since", "sincere", "six", "sixty", "so", "some", "somehow", "someone", "something", "sometime", "sometimes",
    "somewhere", "still", "such", "system", "take", "ten", "than", "that", "the", "their", "them", "themselves", "then",
    "thence", "there", "thereafter", "thereby", "therefore", "therein", "thereupon", "these", "they", "thick", "thin",
    "third", "this", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "top",
    "toward", "towards", "twelve", "twenty", "two", "un", "under", "until", "up", "upon", "us", "very", "via", "was", "we",
    "well", "were", "what", "whatever", "when", "whence", "whenever", "where", "whereafter", "whereas", "whereby",
    "wherein", "whereupon", "wherever", "whether", "which", "while", "whither", "who", "whoever", "whole", "whom", "whose",
    "why", "will", "with", "within", "without", "would", "yet", "you", "your", "yours", "yourself", "yourselves", "above",
    "across", "after", "afterwards", "again", "against", "ago", "ahead", "ain't", "almost", "along", "already", "also",
    "although", "always", "among", "amongst", "amoungst", "amount", "an", "and", "another", "any", "anyone", "anything",
    "anyway", "anywhere", "are", "around", "as", "at", "back", "be", "became", "because", "become", "becomes", "becoming",
    "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "bottom",
    "but", "by", "can", "can't", "cannot", "cant", "co", "com", "could", "couldn't", "de", "describe", "detail", "did",
    "didn't", "do", "does", "doesn't", "doing", "don't", "down", "due", "during", "each", "eg", "eight", "either", "eleven",
    "else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except",
    "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "former", "formerly", "forty", "found", "four", "from",
    "front", "full", "further", "get", "give", "go", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he",
    "he'd", "he'll", "he's", "hence", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's",
    "i", "i'd", "i'll", "i'm", "i've", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "it's", "its", "itself",
    "let's", "me", "mightn't", "mill", "mine", "moreover", "mostly", "move", "much", "mustn't", "my", "myself", "name",
    "namely", "neither", "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now",
    "nowhere", "of", "off", "often", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "our",
    "ours", "ourselves", "out", "over", "own", "part", "per", "perhaps", "please", "put", "rather", "re", "same", "see",
    "seem", "seemed", "seeming", "seems", "serious", "several", "she", "should", "show", "side", "since", "sincere", "six",
    "sixty", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system",
    "take", "ten", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "there's", "these", "they",
    "they'd", "they'll", "they're", "they've", "this", "those", "through", "to", "too", "under", "until", "up", "upon", "us",
    "very", "via", "was", "we", "well", "were", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who",
    "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're", "you've", "your",
    "yours", "yourself", "yourselves", "alone", "along", "already", "also", "although", "always", "am", "among", "amongst",
    "amount", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anyway", "anywhere", "are", "around", "as",
    "at", "back", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind",
    "being", "below", "beside", "besides", "between", "beyond", "both", "bottom", "but", "by", "can", "can't", "cannot",
    "cant", "co", "con", "could", "couldn't", "de", "describe", "detail", "do", "done", "down", "due", "during", "each",
    "eg", "eight", "either", "eleven", "else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone",
    "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former",
    "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "go", "had", "has", "hasnt",
    "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", "herself", "him", "himself",
    "his", "how", "however", "hundred", "ie", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "its", "itse",
    "keep", "last", "latter", "latterly", "least", "less", "ltd", "made", "many", "may", "me", "meanwhile", "might", "mill",
    "mine", "moreover", "more", "most", "mostly", "move", "much", "must", "my", "myself", "name", "namely", "neither", "never",
    "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off",
    "often", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out",
    "over", "own", "part", "per", "perhaps", "please", "put", "rather", "re", "same", "see", "seem", "seemed", "seeming",
    "seems", "serious", "several", "she", "should", "show", "side", "since", "sincere", "six", "sixty", "so", "some",
    "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system", "take", "ten",
    "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefore",
    "therein", "thereupon", "these", "they", "thick", "thin", "third", "this", "those", "though", "three", "through",
    "throughout", "thru", "thus", "to", "together", "too", "top", "toward", "towards", "twelve", "twenty", "two", "un",
    "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "when", "whence",
    "whenever", "where", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while",
    "whither", "who", "whoever", "whole", "whom", "whose", "why", "will", "with", "within", "without", "would", "yet", "you",
    "your", "yours", "yourself", "yourselves", "above", "across", "after", "afterwards", "again", "against", "ago", "ahead",
    "ain't", "almost", "along", "already", "also", "although", "always", "among", "amongst", "amoungst", "amount", "an", "and",
    "another", "any", "anyone", "anything", "anyway", "anywhere", "are", "around", "as", "at", "back", "be", "became",
    "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside",
    "besides", "between", "beyond", "both", "bottom", "but", "by", "can", "can't", "cannot", "cant", "co", "com", "could",
    #Version 0.1.2
    "couldn't", "de", "describe", "detail", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "due",
    "during", "each", "eg", "eight", "either", "eleven", "else", "elsewhere", "empty", "enough", "etc", "even", "ever",
    "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first",
    "five", "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "go", "had",
    "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "he'd", "he'll", "he's", "hence", "her", "here", "here's",
    "hers", "herself", "him", "himself", "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "inc",
    "indeed", "interest", "into", "is", "it", "it's", "its", "itself", "let's", "me", "mightn't", "mill", "mine", "moreover",
    "mostly", "move", "much", "mustn't", "my", "myself", "name", "namely", "neither", "nevertheless", "next", "nine", "no",
    "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once", "one", "only",
    "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own", "part", "per", "perhaps",
    "please", "put", "rather", "re", "same", "see", "seem", "seemed", "seeming", "seems", "serious", "several", "she",
    "should", "show", "side", "since", "sincere", "six", "sixty", "so", "some", "somehow", "someone", "something", "sometime",
    "sometimes", "somewhere", "still", "such", "system", "take", "ten", "than", "that", "the", "their", "them", "themselves",
    "then", "thence", "there", "thereafter", "thereby", "therefore", "therein", "thereupon", "these", "they", "thick", "thin",
    "third", "this", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "top",
    "toward", "towards", "twelve", "twenty", "two", "un", "under", "until", "up", "upon", "us", "very", "via", "was", "we",
    "well", "were", "what", "whatever", "when", "whence", "whenever", "where", "whereafter", "whereas", "whereby", "wherein",
    "whereupon", "wherever", "whether", "which", "while", "whither", "who", "whoever", "whole", "whom", "whose", "why", "will",
    "with", "within", "without", "would", "yet", "you", "your", "yours", "yourself", "yourselves", "above", "across", "after",
    "afterwards", "again", "against", "ago", "ahead", "ain't", "almost", "along", "already", "also", "although", "always",
    "among", "amongst", "amoungst", "amount", "an", "and", "another", "any", "anyone", "anything",
    #Version 0.1.3
    "above", "across", "after", "afterwards", "again", "against", "ago", "ahead", "ain't", "almost", "along", "already", "also",
    "although", "always", "among", "amongst", "amoungst", "amount", "an", "and", "another", "any", "anyone", "anything", "anyway", 
    "anywhere", "are", "around", "as", "at", "back", "be", "became", "because", "become", "becomes", "becoming", "been", "before",
    "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "bottom", "but", "by", "can", "can't", 
    "cannot", "cant", "co", "com", "could", "couldn't", "de", "describe", "detail", "did", "didn't", "do", "does", "doesn't", "doing", 
    "don't", "down", "due", "during", "each", "eg", "eight", "either", "eleven", "else", "elsewhere", "empty", "enough", "etc", "even", 
    "ever", "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", 
    "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "go", "had", "hadn't", "has", "hasn't",
    "have", "haven't", "having", "he", "he'd", "he'll", "he's", "hence", "her", "here", "here's", "hers", "herself", "him", "himself",
    "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "it's",
    "its", "itself", "let's", "me", "mightn't", "mill", "mine", "moreover", "mostly", "move", "much", "mustn't", "my", "myself",
    "name", "namely", "neither", "never", "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "not",
    "nothing", "now", "nowhere", "of", "off", "often", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise",
    "our", "ours", "ourselves", "out", "over", "own", "part", "per", "perhaps", "please", "put", "rather", "re", "same", "see",
    "seem", "seemed", "seeming", "seems", "serious", "several", "she", "should", "show", "side", "since", "sincere", "six", "sixty", 
    "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system", "take", "ten", 
    "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefore", 
    "therein", "thereupon", "these", "they", "thick", "thin", "third", "this", "those", "though", "three", "through", 
    "throughout", "thru", "thus", "to", "together", "too", "top", "toward", "towards", "twelve", "twenty", "two", "un", 
    "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "when", "whence", 
    "whenever", "where", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while", 
    "whither", "who", "whoever", "whole", "whom", "whose", "why", "will", "with", "within", "without", "would", "yet", "you", 
    "your", "yours", "yourself", "yourselves""hers","herself","him","himself","his","how","how's","i","i'd","i'll","i'm","i've",
    "if","in","inc","indeed","interest","into","is","it","it's","its","itself","let's","me","mightn't","mill","mine","moreover",
    "mostly","move","much","mustn't","my","myself","name","namely","neither","never","nevertheless","next","nine","no","nobody",
    "none","noone","nor","not","nothing","now","nowhere","of","off","often","on","once","one","only","onto","or","other","others",
    "otherwise","our","ours""ourselves","out","over","own","part","per","perhaps","please","put","rather","re","same","see""seem","seemed",
    "seeming","seems","serious","she","should","show","since""sincere","six","sixty","so","some","somehow","someone","sometime","sometimes",
    "somewhere","still","such","system""take","ten","than","that","the","their""them","themselves","then","thence","there","thereafter","thereby","therefore",
    "therein""thereupon","these","they","thick","thin","third","those","though","three","through","throughout","thru","thus","to","together","too","top","toward",
    "towards","twelve","twenty","two","un","until","up","upon","us","very","via","was","we","well","were","whatever","when","whence","whenever","where",
    "whereafter""whereas","whereby","wherein","whereupon","wherever","whether","which","while","whither","who","whoever","whole","whom","whose","why","will","with",
    "within","without","would","yet","you","your","yourself","yourselves","above","across","after","afterwards","against","ago","ahead","ain't","almost","along",
    "already","also","although","always","amongst""amoungst","amount","an","and","another","any","anyone","anything","anywhere","are","around","as","at",
    "back""be","became","because","become","becomes","becoming","been","before","beforehand","behind","being","below","beside","besides","between","beyond",
    "both","bottom","but","by","can","can't","cannot","cant""co","com","could","couldn't","de","describe","detail","did","didn't"

])

# Remove stopwords
def remove_stopwords(words):
    filtered_words = [word for word in words if word not in stop_words]
    return filtered_words

# Simple stemming function (cutting off common word endings)
def stem_word(word):
    endings = ["s", "es", "ed", "ing"]
    for ending in endings:
        if word.endswith(ending):
            return word[:-len(ending)]
    return word

# Apply stemming to a list of words
def stem_words(words):
    stemmed_words = [stem_word(word) for word in words]
    return stemmed_words

# Simple lemmatization function (custom rules)
def lemmatize_word(word):
    # Add custom lemmatization rules here if needed
    return word

# Apply lemmatization to a list of words
def lemmatize_words(words):
    lemmatized_words = [lemmatize_word(word) for word in words]
    return lemmatized_words

# Tokenize, remove stopwords, stem, and lemmatize
tokenized_words = tokenize(text)
filtered_words = remove_stopwords(tokenized_words)
stemmed_words = stem_words(filtered_words)
lemmatized_words = lemmatize_words(filtered_words)

# Print the results
print("Original Words:", tokenized_words)
print("Filtered Words (Stopwords Removed):", filtered_words)
print("Stemmed Words:", stemmed_words)
print("Lemmatized Words:", lemmatized_words)

