package test1;
import java.io.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Main {
static String encrypt(String s) {
try {
char tmp;
byte[] s1 = s.getBytes("utf-8");
StringBuffer rtn = new StringBuffer();
for (int i =s1.length - 1; i >= 0; --i) {
Random random = new Random();
int r = random.nextInt(100);
rtn.append((char)r);
rtn.append((char)(~s1[i]-r));
}
return rtn.toString();
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
return "";
}
static String decrypt(String s) throws UnsupportedEncodingException {
StringBuffer rtn = new StringBuffer();
byte high;
byte low;
byte b[] = new byte[s.length()/2];
for (int i = 0; i < s.length() - 1; i += 2) {
high = (byte) s.charAt(i);
low = (byte) s.charAt(i + 1);
low = (byte) (low + high);
b[(s.length()-i-1)/2] = (byte) ~low;
}
return new String(b, "utf-8");
// return URLEncoder.encode(rtn.reverse().toString(), "UTF-8");
}
public static void main(String[] args) throws UnsupportedEncodingException {
Scanner in = new Scanner(System.in);
String res;
String _s;
try {
_s = in.nextLine();
} catch (Exception e) {
_s = null;
}
String en = encrypt(_s);
System.out.println(en);
res = decrypt(en);
System.out.println(res);
}
}