import java.util.Scanner;

fun main(args : Array<String>) {
  val input = Scanner(System.`in`)
  val sum = 1 + 2 + 3
  
  while (input.hasNext()) {
    val A = input.nextInt()
    val B = input.nextInt()
    
    println(sum - A - B)
  }
}