#include <iostream>
#include <conio.h>
using namespace std ;

int datas[2][200] ;
int datanum ;

int sum[200] ;
int solve[200] ;

int main()
{
	cin >> datanum ;

	for( int i = 0 ; i < datanum ; i ++ )
	{
		cin >> datas[0][i] ;
		cin >> datas[1][i] ;

		sum[i] = datas[0][i] + datas[1][i] ;
	}

	for( int i = 0 ; i < datanum ; i ++ )
	{
		for( int j = 1 ; j < 7 ; j ++ )
		{
			if( (sum[i] / 10*j) < 10 )
			{
				solve[i] = j+1 ;
				j = 10 ;

				cout << solve[i] << "\n" ;
			}
		}
	}

	_getch() ;
	return 0 ;
}