#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

#define forn(i, n) for (int i = 0; i < (int) n; i++)
#define ford(i, n) for (int i = (int) n - 1; i >= 0; i--)

const int NMAX = 100010;
const int MMAX = 101;

int n, m;
char s[NMAX][MMAX];

void solve(int st)
{
	int now = -1;
	forn(i, n)
		if (s[i][st] != '.')
		{
			now = i;
			break;
		}
	int digit = s[now][st] - '0';
	for (int i = now - 1; i >= 0; --i)
	{
		if (st == m - 1 || (s[i][st + 1] == '9' && s[i + 1][st + 1] == '0'))
			digit = (9 + digit) % 10;
		s[i][st] = '0' + digit;
	}
	digit = s[now][st] - '0';
	for (int i = now + 1; i < n; ++i)
	{
		if (st == m - 1 || (s[i][st + 1] == '0' && s[i - 1][st + 1] == '9'))
			digit = (1 + digit) % 10;
		s[i][st] = '0' + digit;
	}
}

int main()
{
	freopen("calendar.in", "r", stdin);
	freopen("calendar.out", "w", stdout);

	n = 0;
	while (scanf("%s", s[n]) > 0)
		n++;
	m = strlen(s[0]);

	ford(i, m)
		solve(i);

	forn(i, n)
		printf("%s\n", s[i]);

	return 0;
}
