提示: 欢迎访问OurACM平台。
Problem 1675 The Seventy-seven Problem

Accept: 158    Submit: 376
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

One day, daxia writes a big number N that can be divided by seventy-seven on the paper.
But oaiei is careless; he spilt some ink on the number, so that the four continuous digits can not be read clearly.
Now daxia asks you to calculate how large the number N could be.

Input

There are multiple test cases. For each test case, the first line contains a big integer N (10^5<=N<=10^1000000) which had lost four continuous digits, the lost four continuous digits are represented as "xxxx".

Output

For each test case, you should output the number N, so that N is the maximum number that can be divided by seventy-seven.

Sample Input

1xxxx 1234567xxxx7654321

Sample Output

19943 123456799337654321

Source

FOJ月赛-2008年12月

Submit  Back  Status  Discuss