#abc363f. F - Palindromic Expression

F - Palindromic Expression

Score : 500500 points

问题陈述

给定一个整数 NN。打印一个满足以下所有条件的字符串 SS。如果不存在这样的字符串,请打印 -1

  • SS 是一个长度在 1110001000 之间(包括两端)的字符串,由字符 1, 2, 3, 4, 5, 6, 7, 8, 9*(乘法符号)组成。
  • SS 是一个回文。
  • SS 的第一个字符是一个数字。
  • SS 作为公式计算时,其值等于 NN

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

You are given an integer NN. Print a string SS that satisfies all of the following conditions. If no such string exists, print -1.

  • SS is a string of length between 11 and 10001000, inclusive, consisting of the characters 1, 2, 3, 4, 5, 6, 7, 8, 9, and * (multiplication symbol).
  • SS is a palindrome.
  • The first character of SS is a digit.
  • The value of SS when evaluated as a formula equals NN.

Constraints

  • 1N10121 \leq N \leq 10^{12}
  • NN is an integer.

Input

The input is given from Standard Input in the following format:

NN

Output

If there is a string SS that satisfies the conditions exists, print such a string. Otherwise, print -1.

Sample Input 1

363

Sample Output 1

11*3*11

S=S = 11*3*11 satisfies the conditions in the problem statement. Another string that satisfies the conditions is S=S= 363.

Sample Input 2

101

Sample Output 2

-1

Note that SS must not contain the digit 0.

Sample Input 3

3154625100

Sample Output 3

2*57*184481*75*2