Alice decided that she needed to put in an access code to control the ship. She believes that the access code should be of the form
a:b:c
, where
a
,
b
and
c
are integers. Moreover, the number
a
must be simple, the number
b
must be a palindrome, and the number
c
must be even. Captain Green came up with the code.
You've been given the task of writing a program that would print
True
if a given access code matches the rules and
False
if it doesn't. So that your program can be used for other checks, the captain asks you to issue a program using three functions:
-
isPrime(n)
- a function that determines whether the number
n
is prime or not;
-
isPalindrome(n)
- a function that determines whether the number
n
is a palindrome;
-
isEven(n)
- a function that determines whether the number
n
is even.
All checks of a number for primality, palindrome and evenness must be carried out only using these functions!
Input
The program receives one string as input - the access code that Captain Zeleny came up with.
Imprint
Print
True
if the access code matches Alice's rules, otherwise print
False
.
Examples
# |
Input |
Output |
1 |
7:101:14 |
True |
2 |
101:101:101 |
False |
3 |
qwerty |
False |
Запрещенные операторы:::-1;reverse