#include<stdio.h> int main(){ int X = 0; int N = 0; scanf("%d %d",&X,&N); X = (X+N%7)%7; if(X==0) printf("%d",7); else printf("%d",X); return 0; }
#include<stdio.h> int main(){ int X = 0; int N = 0; scanf("%d %d",&X,&N); X = (X+N%7)%7; if(X==0) printf("%d",7); else printf("%d",X); return 0; }