#include<iostream>
using namespace std;
class data{
public:
int x[4];
int y[4];
void encrypt(){
save();
for(int i=0;i<4;i++)
x[i]=(x[i]+7)%10;
int x=this->x[0];this->x[0]=this->x[2];this->x[2]=x;
x=this->x[1];this->x[1]=this->x[3];this->x[3]=x;
}
void save(){
for(int i=0;i<4;i++)
this->y[i]=this->x[i];
}
void reversedata(){
for(int i=0;i<4;i++)
this->x[i]=this->y[i];
}
void display(){
for(int i=0;i<4;i++)
cout<<this->x[i];
cout<<endl;
}
};
int main(){
data a;
for(int i=0;i<4;i++){
cout<<"请输入第"<<i+1<<"个数据:";
cin>>a.x[i];
}
a.encrypt();
a.display();
a.reversedata();
a.display();
}