#include<iostream> using namespace std; int main() { int a,b,i,cnt=0; cin>>a>>b; for(i=1;i<=a;i++) if(a%i==0&&b%i==0) cout<<i<<" ",cnt++; cout<<"\n"<<cnt; }