<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def check_ip(original_ip):
    '''
    Checks the format of an IP address and returns it if it is correct. Otherwise it returns None.
    ''' 
    ip = original_ip.strip()
    parts = ip.split('.')
    if len(parts) != 4:
        return None
    for p in parts:
        try:
            p = int(p)
            if (p < 0) or (p > 255):
                return None
        except:
            return None
    return ip