using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int n = 873921779, tmp = n;
int[] arr = new int[10];
while (tmp != 0)
{
arr[tmp % 10]++;
tmp = tmp / 10;
}
Console.WriteLine(n);
for (int i = 0; i < arr.Length; i++)
Console.WriteLine("{0} {1}", i, arr[i]);
}
}
}