"""
Ingly

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.
Print the resulting string.

Adapted from W3Resource, problem 6:
https://www.w3resource.com/python-exercises/string/
"""

string = input("Enter a string: ")

if len(string) >= 3:
    if string[-3:] != "ing":
        string += "ing"
    else:
        string += "ly"

print(string)
