#include <iostream>
using namespace std;
int main()
{
int A, B;
while (1) {
cin >> A >> B;
if (A < 0 || A>10 || B < 0 || B>10) {
return 0;
}
if (A == 0 && B == 0)
break;
cout << A + B << "\n";
}
}
#include <iostream>
using namespace std;
int main()
{
int N, count = 0;
int x, y, z = 0;
cin >> N;
z = N;
if (N < 0 || N >99)
return 0;
while (1) {
x = N / 10;
y = N % 10;
N = (N % 10) * 10 + (N / 10 + N % 10) % 10;
count++;
if (N == z)
break;
}
cout << count;
}