package hd11;
import java.util.Scanner;
import java.math.*;
public class Nyoj14 {
public static void main(String[] args){
Scanner cin=new Scanner(System.in);
while(cin.hasNext()){
String s = cin.next();
String ss =cin.next();
Long i = Long.parseLong(s.replaceAll("\\+",""),16);
Long j = Long.parseLong(ss.replaceAll("\\+",""),16);
i+=j;
if(i<0)System.out.println("-"+Long.toHexString(-i).toUpperCase());
else System.out.println(Long.toHexString(i).toUpperCase());
}
}
}
replaceAll () 的两个参数都是正则表达式,前两个的\\交给正则表达式,后面的是进行比较的内容。