#!/usr/bin/python3

"""
find the perimeter of an island made of 1
"""


def island_perimeter(grid):
    """
    function
    """
    if grid:
        count = 0
        for row in grid:
            for elem in row:
                if elem == 1:
                    count += 1
                    print("1 {}".format(count))

#           UP
                if 
#           LEFT

#           DOWN

#           RIGHT

    return cont
