QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 1024 MB مجموع النقاط: 100 قابلة للهجوم ✓

#18112. The Reason Why Hobanwoo Was Late for School 2

الإحصائيات

When adventuring in another world, one needs a weapon, so Hobanwoo is currently learning how to use the Prime-Prime Sword received from a god.

To use the Prime-Prime Sword, one must create a "prime-prime" number using two two-digit prime numbers $A$ and $B$, and a positive integer $N$.

A prime-prime number does not necessarily have to be a prime number itself, but every consecutive two-digit sequence within the number must be a prime number.

For example, $973$ is a prime-prime number because $97$ and $73$ are both prime, but $937$ is not a prime-prime number because $93$ is not a prime number.

There is one constraint when creating a prime-prime number: you must create an $N$-digit prime-prime number where the first two digits are $A$ and the last two digits are $B$.

Help Hobanwoo, who is not yet familiar with how to use the sword, to create a prime-prime number.

Input

The first line contains $A$, $B$, and $N$ separated by spaces. It is guaranteed that $A$ and $B$ are two-digit prime numbers. $(7 \le N \le 100)$

Output

If it is possible to create a prime-prime number with the given values, output any such prime-prime number. If it is not possible, output -1.

Note

A prime number is an integer greater than or equal to 2 that is divisible only by 1 and itself.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.