Get the front element
front = q . popleft ( ) NEW_LINE i = front [ 0 ] NEW_LINE j = front [ 1 ] NEW_LINE t = front [ 2 ] NEW_LINE if ( a [ i ] [ j ] ) : NEW_LINE INDENT continue NEW_LINE DEDENT a [ i ] [ j ] = 1 NEW_LINE