#B3685. Digit Sum, Square, and Cube

    ID: 11344 Type: Default 1000ms 256MiB

Digit Sum, Square, and Cube

Digit Sum, Square, and Cube

Given a three-digit integer \(n\), you are required to perform the following operations:

  1. Calculate the sum of the digits of \(n\).
  2. Compute the square of the sum, i.e., \((\text{sum})^2\).
  3. Compute the cube of the sum, i.e., \((\text{sum})^3\).

For example, if \(n=123\):

  • The sum of its digits is \(1+2+3=6\);
  • The square of the sum is \(6^2=36\);
  • The cube of the sum is \(6^3=216\).

inputFormat

The input consists of a single three-digit integer \(n\) provided on one line.

outputFormat

Output three numbers separated by a space: the sum of the digits of \(n\), its square, and its cube.

sample

123
6 36 216