#include <bits/stdc++.h>
using namespace std;
int main(){
	int q,w,e,r,t;
	cin>>q;
	w=(q%10+5)%10;
	e=(q/10%10+5)%10;
	r=(q/100%10+5)%10;
	t=(q/1000+5)%10;
	cout<<w<<e<<r<<t;
	return 0;
	}
/**************************************************************
	Problem: 1109
	User: ljl2
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/