#P417. 【例72.2】 取出整数的一部分

【例72.2】 取出整数的一部分

Description

Given an integer, we can perform a truncation operation on it.
If kk is positive, we take the first kk digits from left to right. For example, if the input is 44, we return the first 44 digits, which is 14561456;
If kk is negative, we take the last k|k| digits from right to left. For example, if the input is 3-3, we return the last 33 digits, which is 678678;
If the input is 00, we return the original number, which is 145678145678;
If the absolute value of the input number is greater than the number of digits in the given number (e.g., 88 or 8-8), we return "ErrorError".
Please implement this operation.

Input Format

The first line contains a positive integer nn (1n1091≤n≤10^9).
The second line contains an integer kk (10k10−10≤k≤10).

Output Format

Output a single line containing either an integer or "ErrorError". If the returned number contains leading zeros, they should be removed.

Sample

33010
-3
10