#include<iostream>
#include<cmath>
#include<math.h>
#include<string>
#include <fstream>
#include <cctype>
#include <iomanip>
#include <algorithm>

using namespace std;
int main()
{
	freopen("DATA3.txt","r",stdin);
	freopen("OUT3.txt","w",stdout);
	int n,d,x,y,z,a[20],a2[20],i;
	string l;
	for(x=0;x<5;x++)
	{
		cin >> l;
		for(y=0;y<20;y++)
			a[y]=a2[y]=0;
		d=l.length();
		for(y=0;y<d;y++)
		{
			if(l[y]!='.')
				a[y]=l[y]-48;
		}
		for(y=0;y<5;y++)
		{
			for(z=0;z<d;z++)
			{
				if(a[z]!=0)
				{
					if(z+a[z]<d-1)
					{
						a2[z+a[z]]+=a[z];
						a[z]=0;
					}
					else
					{
						a[z]=0;
					}
				}
			}
			for(i=0;i<20;i++)
			{
				a[i]=a2[i];
				a2[i]=0;
			}
			for(i=0;i<d;i++)
			{
				if(a[i]==0)
				{
					cout << ".";
				}
				else if(a[i]>0 && a[i]<9)
				{
					cout << char(a[i]+'0');
				}
			}
			cout << endl;
		}
		
	}
	return(0);
}
