#C13517. Find Happy Numbers

    ID: 43064 Type: Default 1000ms 256MiB

Find Happy Numbers

Find Happy Numbers

You are given a positive integer n and your task is to compute the first n happy numbers. A happy number is defined as follows: Start with any positive integer and replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1, or it loops endlessly in a cycle that does not include 1. If the process ends in 1, the number is considered happy.

Note: If n = 0, then no output should be produced.

Example:

Input: 5
Output: 1 7 10 13 19

Implement your solution such that it reads from standard input (stdin) and writes the output to standard output (stdout). The output numbers should be space-separated on a single line.

inputFormat

The input is a single integer n provided through standard input, which represents the number of happy numbers to generate.

outputFormat

Output the first n happy numbers in order, separated by a single space on one line. If n is 0, output nothing.

## sample
5
1 7 10 13 19