Write a program that prints the following two lines.
There is no input.
On the first line, print the perfect numbers between $1000$ and $9999$ (inclusive), separated by single spaces. On the second line, print every integer between $100$ and $999$ (inclusive) that equals the sum of the cubes of its digits, separated by single spaces.