#include <iostream>
using namespace std;
int nod(int a, int b){
if (a <= 0 || b <= 0)
return 0;
cout << "OK\n";
int c = 0;
while(b > 0){
cout << a << " " << b << "\n";
c = a % b;
a = b;
b = c;
}
return a;
}
int main()
{
cout << "Result: " << nod(9,15) << "\n";
return 0;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KIAp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBub2QoaW50IGEsIGludCBiKXsKICAgIGlmIChhIDw9IDAgfHwgYiA8PSAwKQogICAgICAgIHJldHVybiAwOwogICAgY291dCA8PCAiT0tcbiI7CiAgICBpbnQgYyA9IDA7CiAgICB3aGlsZShiID4gMCl7CgkJY291dCA8PCBhIDw8ICIgIiA8PCBiIDw8ICJcbiI7CiAgICAgICAgYyA9IGEgJSBiOwogICAgICAgIGEgPSBiOwoJCWIgPSBjOwogICAgfQogICAgcmV0dXJuIGE7Cn0KaW50IG1haW4oKQp7CiAgICBjb3V0IDw8ICJSZXN1bHQ6ICIgPDwgbm9kKDksMTUpIDw8ICJcbiI7CiAgICByZXR1cm4gMDsKfQ==