def check_weak_prime(n):
    if (not isprime(n)):
        return False
    digits = [int(i) for i in str(n)]
    for position in range(len(digits)):
        digits2 = [i for i in digits]
        for j in range(10):
            if (j != digits[position]):
                digits2[position] = j
                m = 0
                for i in digits2:
                    m = ((10 * m) + i)
                if isprime(m):
                    return False
    return True
def check_weak_prime(n):
    if (not isprime(n)):
        return False
    digits = [int(i) for i in str(n)]
    for position in range(len(digits)):
        digits2 = [i for i in digits]
        for j in range(10):
            if (j != digits[position]):
                digits2[position] = j
                m = 0
                for i in digits2:
                    m = ((10 * m) + i)
                if isprime(m):
                    return False
    return True