Under construction

Still being built. Things may change

Linear Expression

Time limit1sMemory limit1024 MB

Summary
Given integers A and B, the task prints the linear expression Ax+B in standard form, dropping zero terms and coefficients of 1.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Mathematics has standard forms for expression types that appear often. For example, a polynomial in one variable is written as Anxn⊕An−1xn−1⊕⋯⊕A0A_nx^n \oplus A_{n-1}x^{n-1} \oplus \cdots \oplus A_0, where each ⊕\oplus is either a plus or a minus sign. The terms are ordered by decreasing power of the variable, and unnecessary terms, coefficients, and operator signs are left out. Write a program that takes two integers AA and BB and prints the standard form of the linear expression Ax+BAx+B.

Input

The only line contains two integers AA and BB (−1000≤A≤1000-1000 \le A \le 1000, −1000≤B≤1000-1000 \le B \le 1000).

Output

Print the standard form of Ax+BAx + B on a single line without spaces.

Examples3

  1. Example 1

    Input
    3 0
    
    Expected output
    3x
    
  2. Example 2

    Input
    1 -7
    
    Expected output
    x-7
    
  3. Example 3

    Input
    -3 3
    
    Expected output
    -3x+3