#include<iostream>
#include<cstdlib>
using namespace std;
int getint(int a,int b){
	if(a==0)return b;
	if(b==0)return a;
	cout<<a<<endl;
	return getint(a-1,b-1);
}

int ungetint(int a){
	if(a<=0)return 0;
	int i=0;
	for(i=0;i<a;i++)cout<<i<<endl;
	return i;
}
int main(){
	int a,b;
	cin>>a>>b;
	cout<<max(a,b)<<endl;
	_sleep(10000);
	cout<<ungetint(a)<<endl;
	cout<<getint(a,b)<<endl;
	return 0;
}