#include <cstdio> using namespace std; int sumnum(int n){ int sum=0; while (n>0){ sum=sum+n%10; n=n/10; } return sum; } int main(){ int arr; while (scanf("%d",&arr)!=EOF){ printf("%d %d\n", sumnum(arr), sumnum(arr*arr)); } }