
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int d = sc.nextInt();
            int m = sc.nextInt();
            int a = sc.nextInt();
            System.out.println(Solution.dia_de_la_setmana(d,m,a));
        }
    }
}
