A.cpp 250 B

123456789101112131415
  1. //
  2. // Created by jal on 2019-04-01.
  3. //
  4. #include <bits/stdc++.h>
  5. using namespace std;
  6. int main(){
  7. int a,b;
  8. while(cin >> a >> b){
  9. if(a == 0 && b == 0)break;
  10. int c = (a+b)%7;
  11. if(c==0)c=7;
  12. cout << c<<endl;
  13. }
  14. }