ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

[Online] ICPC Ural Regional Contest Qualifier 2026

About     Problems     Submit solution     Judge status     Standings
Contest is over

B. Another Puzzle

Time limit: 1.0 second
Memory limit: 256 MB
You are required to find a positive integer that satisfies the following requirements:
  1. This number has six digits (we will denote this number as abcdef);
  2. All digits are distinct;
  3. The parity of the digits alternates;
  4. The difference between adjacent digits is greater than 1;
  5. The two-digit numbers ab, cd, and ef do not contain leading zeros;
  6. ab is divisible by ef;
  7. cd is divisible by ef.

Input

The only line of input contains 0. You may ignore it.

Output

Print a number that satisfies all the requirements described above.

Sample

inputoutput
0
123456

Notes

The answer in the example is incorrect; it satisfies only 4 requirements.
Problem Author: Vadim Barinov
Problem Source: The 2026 ICPC Ural Qualification