//1066
#include <iostream>
using namespace std;
int main(){
int a, b, l, h, s;
scanf("%d %d %d %d %d",&a, &b, &l, &h, &s);
for(int i = 0; i < a; i++){
for(int j = 0; j < b; j++){
int temp;
scanf("%d", &temp);
if(temp <= h && temp >= l)
temp = s;
if(j!=0) printf(" ");
printf("%03d", temp);
}
printf("\n");
}
return 0;
}
用cin cout输入输出会超时