#include<bits/stdc++.h>
using namespace std;
int main(){
	int X,S,a,b,c,d;
	scanf("%d",&X);
	a=(X%10+5)%10;
	b=(X/10%10+5)%10;
	c=(X/100%10+5)%10;
	d=(X/1000%10+5)%10;
	S=a*1000+b*100+c*10+d;
	printf("%d",S);
	return 0;
}
/**************************************************************
	Problem: 1109
	User: toughuatao1
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2076 kb
****************************************************************/