document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.util.*;
  2.  
  3. public class Solver {
  4.  
  5. public static void main(String[] args) {
  6. Scanner cin = new Scanner(System.in);
  7. int a,b;
  8.  
  9. while(cin.hasNext())
  10. {
  11. a=cin.nextInt();
  12. b=cin.nextInt();
  13. while(a*b!=0)
  14. {
  15. if(a>b)
  16. {
  17. a%=b;
  18. }
  19. else
  20. {
  21. b%=a;
  22. }
  23. };
  24. System.out.println(a+b);
  25. }
  26. }
  27. }
');