placeValue function
def placeValue ( a , ans , i , p , v ) : NEW_LINE INDENT p = p % v ; NEW_LINE if ( ans [ p ] == 0 ) : NEW_LINE INDENT ans [ p ] = a [ i ] ; NEW_LINE DEDENT else : NEW_LINE INDENT if ( ans [ p ] == a [ i ] ) : NEW_LINE INDENT print ( a [ i ] , end = " , " ) ; NEW_LINE DEDENT else : NEW_LINE DEDENT DEDENT