def compare_locations(loc1, loc2):
    """Checks whether locations are within 1kb of each other"""
    if loc1[0] == loc2[0] and loc1[2] == loc2[2] and abs(int(loc1[1]) - int(loc2[1])) < 1000:
        return 'close'
    else:
        return 'far'