import java.util.Scanner;

public class Section057 {
	public static void main(String[] args) {
		Scanner scanf = new Scanner(System.in);
		int x, i, k, mok, nmg, m, j;
		int a[] = new int[6];
		while (true)
		{
			x = scanf.nextInt();
			if (x == 999999)
				break;
			k = x;
			for (i = 0; i <= 5; i++)
			{
				mok = x / 10;
				nmg = x - mok * 10;
				a[i] = nmg;
				x = mok;
			}
			m = 0;
			for (i = 0; i <= 5; i++)
			{
				if (a[i] != 0)
					break;
			}
			for (j = i; j <= 4; j++)
			{
				m += a[j];
				m *= 10;
			}
			m += a[5];
			x = m + k;
			System.out.printf("%d %d %d\n", k, m, x);
		}
		scanf.close();
	}
}
