const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let answer = "";
rl.on("line", line => {
input.push(line.split(" "));
if (input[input.length - 1][0] === "0" && input[input.length - 1][1] === "0") rl.close();
}).on("close", () => {
input = input.slice(input.length - 1, 1);
input.forEach(v => (answer += `${+v[0] + +v[1]}\n`));
console.log(input);
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let answer = "";
rl.on("line", line => {
input.push(line.split(" "));
}).on("close", () => {
input.forEach(v => (answer += `${+v[0] + +v[1]}\n`));
console.log(answer);
process.exit();
});3
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = null;
let resultValue = null;
let count = 0;
const calculate = () => {
count++;
let front = null;
let back = null;
let inputArray = null;
resultValue.split("").length >= 2 ? (inputArray = resultValue.split("")) : (inputArray = (0 + resultValue).split(""));
front = inputArray[1];
back = inputArray.reduce((prev, curr) => +prev + +curr) % 10;
return front + back;
};
rl.on("line", line => {
input = line;
rl.close();
}).on("close", () => {
resultValue = input;
do {
resultValue = calculate();
if (input === "0") break;
} while (+input !== +resultValue);
console.log(count);
process.exit();
});