#include <iostream> int main() { unsigned a, b; while (scanf("%u%u", &a, &b) != EOF) { while (a != b) { unsigned c = a % b; if (!c) break; a = b; b = c; } printf("%u\n", b); } }