#include <iostream>
#include <algorithm>
using namespace std;

int from,to;
int line[1000];
int ad;

void solve()
{
	int a = 0,b = 0;

	
	cout << from-15+ad;
	for(int i = from; line[i] != to-15; i++,a++);
	for(int i = from; line[i] != to-15; i--,b++);
	
	if(a < b){
		for(int i = from+1; line[i] != to-15; i++)
			cout << ' ' << line[i];
	}
	else{
		for(int i = from-1; line[i] != to-15; i--)
			cout << ' ' << line[i];
	}
	cout << ' ' << to-15 << endl;

}


int main(void)
{

	int c = 0;
	for(int i = 0; i < 10; i++){
		for(int j = 0; j <= 9; j++,c++){
			line[c] = j;
		}
		for(int j = 5; j > 0; j--,c++){
			line[c] = j;
		}
	}
//	for(int i = 0; i < 30; i++)
//		cout << line[i] << endl;

	while(cin >> from >> to, !cin.eof()){
		ad = 0;
		if(from == 1){
			from += 13;
			ad = 2;
		}
		else
			from += 15;
		to += 15;
		solve();
	}


	return 0;
}