# Write a Python program to add 'ing' at the end of a given string (length should
# be at least 3). If the given string already ends with 'ing' then add 'ly' instead. If the
# string length of the given string is less than 3, leave it unchanged.
# Sample String : 'abc'
# Expected Result : 'abcing'
# Sample String : 'string'
# Expected Result : 'stringly'

str = input("Enter a string:")
result = " "
if len(str) < 3:
    result = str
elif str[-3:] == "ing":
    result = str + "ly"
else:
    result = str + "ing"
print(result)