Under construction

Still being built. Things may change

Integral of a Polynomial

Time limit1sMemory limit256 MB

Summary
Parse a degree-at-most-1 polynomial string and print its integral, writing x^2 as xx and the constant of integration as W.
Level

Easy3 of 10

Topics
String, Implementation, Math, Brute force
Solved
No attempts yet

Problem

A polynomial is an expression that represents a sum of constant multiples of powers of a variable. For example, x2+2x+3x^2+2x+3 is such an expression. One with a single variable is called a polynomial in one variable, written as follows.

f(x)=axn+bxn−1+⋯+cx+df(x) = ax^n + bx^{n-1} + \cdots + cx + d

Write a program that outputs the integral of a given polynomial in one variable whose degree is at most 1.

Input

The first line gives a polynomial in one variable with degree at most 1. It has at most 2 terms, the variable is always xx, and the terms are not separated by spaces. Each coefficient is a nonzero multiple of 2 whose absolute value does not exceed 10,000, and each constant is an integer whose absolute value does not exceed 10,000. No two terms have the same degree. However, when the absolute value of a coefficient is 1, the 1 is omitted. The terms are given in order from highest degree to lowest.

Output

Output the integral of the given polynomial in one variable in the same format as the input. The constant of integration is written as W, and x2x^2 is written as xx.

Hint

The integration used in this problem is ∫xndx=1n+1xn+1+W\int{x^n dx} = \frac{1}{n+1}x^{n+1} + W. (WW is the constant of integration) Also, for integrable functions the sum rule ∫(f(x)+g(x))dx=∫f(x)dx+∫g(x)dx\int{(f(x)+g(x))dx} = \int{f(x)dx} + \int{g(x)dx} holds.

Examples1

  1. Example 1

    Input
    6x+6
    
    Expected output
    3xx+6x+W