#include <iostream>
#include <vector>
#include<string>
#include<set>
#include <stack>
#include <iomanip>
#include <cmath>
#include<map>
#include <deque>
#include <queue>
using namespace std;
using ll = long long;
using ld = long double;

ll gcd(ll a, ll b) {
	while (b > 0) {
		if (a < 0) {
			a = (a % b + b) % b;
		}
		else {
			a %= b;
		}
		swap(a, b);
	}
	return 0;
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
signed main(){
	string s;
	cin >> s;
	ll ans = 0;
	string asw;
	for (ll i = s.size() - 1; i >= 0; --i) {
		if (s[i] == '0' && asw.size() == 0)
			continue;
		else{
			if (s[i] == '2')
				asw += '5';
			else if (s[i] == '5')
				asw += '2';
			else
				asw += s[i];
		}
	}
	cout << asw;
}
