Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/funksiya-baxtli-chiptalar

Lucky ticket

Easy 2000 ms 128 MB 23%
Share

Write a function IsLucky(x) that returns true if the six-digit ticket number $x$ is lucky and false otherwise. The ticket number is written with six digits, padded with leading zeros ($1020$ is $001020$). A ticket is lucky if the sum of its first three digits equals the sum of its last three digits.

Example 1: IsLucky(123060) → true — $1 + 2 + 3 = 0 + 6 + 0$.

Example 2: IsLucky(1020) → false — in $001020$: $0 + 0 + 1 \ne 0 + 2 + 0$.

Write only the function body.

A ticket number goes into the function IsLucky, which returns true

Input

One line with a non-negative integer $x$ — the argument of the function.

Output

The value returned by the function: true or false.

Note

$0 \le x \le 999999$

Examples

Input #1
123060
Output #1
true
Input #2
1020
Output #2
false

Sign in to submit a solution

Signing up is free and takes a minute.