public class Main {
public int Add(int num1,int num2) {
int result;
int ans;
do{
result = num1 ^ num2;
ans = (num1 & num2) << 1;
num1 = result;
num2 = ans;
}while(ans!=0);
return result;
}
public static void main(String[] args){
System.out.println(new Main().Add(1,2));
}
}