import java.util.Scanner;

class Main
{
	public static void main(String[] args){
	
		Scanner scan = new Scanner(System.in);
		Scanner scan2 = new Scanner(System.in);
	
	int ak = 0, bk = 0;
	int a, b, j, w, u;
	
	int kai = scan.nextInt();
	
	for(int i=0; i<kai; i++){
		String stra = scan.next();
		String strb = scan.next();
		
		char[] A = stra.toCharArray();
		char[] B = strb.toCharArray();
		
		int x = 0;
		int c = 0;
		
		for(j=0; j<A.length; j++){}
		for(w=0; w<B.length; w++){}
		
		if(j < w){
			u = j;}
		else{
			u = w;}
		
		for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}}

			if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}}}
				
		System.out.println(ak+" "+bk);
	}
} import java.util.Scanner; Scanner java.util class Main
{
	public static void main(String[] args){
	
		Scanner scan = new Scanner(System.in);
		Scanner scan2 = new Scanner(System.in);
	
	int ak = 0, bk = 0;
	int a, b, j, w, u;
	
	int kai = scan.nextInt();
	
	for(int i=0; i<kai; i++){
		String stra = scan.next();
		String strb = scan.next();
		
		char[] A = stra.toCharArray();
		char[] B = strb.toCharArray();
		
		int x = 0;
		int c = 0;
		
		for(j=0; j<A.length; j++){}
		for(w=0; w<B.length; w++){}
		
		if(j < w){
			u = j;}
		else{
			u = w;}
		
		for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}}

			if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}}}
				
		System.out.println(ak+" "+bk);
	}
} Main public static void main(String[] args){
	
		Scanner scan = new Scanner(System.in);
		Scanner scan2 = new Scanner(System.in);
	
	int ak = 0, bk = 0;
	int a, b, j, w, u;
	
	int kai = scan.nextInt();
	
	for(int i=0; i<kai; i++){
		String stra = scan.next();
		String strb = scan.next();
		
		char[] A = stra.toCharArray();
		char[] B = strb.toCharArray();
		
		int x = 0;
		int c = 0;
		
		for(j=0; j<A.length; j++){}
		for(w=0; w<B.length; w++){}
		
		if(j < w){
			u = j;}
		else{
			u = w;}
		
		for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}}

			if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}}}
				
		System.out.println(ak+" "+bk);
	} main {
	
		Scanner scan = new Scanner(System.in);
		Scanner scan2 = new Scanner(System.in);
	
	int ak = 0, bk = 0;
	int a, b, j, w, u;
	
	int kai = scan.nextInt();
	
	for(int i=0; i<kai; i++){
		String stra = scan.next();
		String strb = scan.next();
		
		char[] A = stra.toCharArray();
		char[] B = strb.toCharArray();
		
		int x = 0;
		int c = 0;
		
		for(j=0; j<A.length; j++){}
		for(w=0; w<B.length; w++){}
		
		if(j < w){
			u = j;}
		else{
			u = w;}
		
		for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}}

			if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}}}
				
		System.out.println(ak+" "+bk);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) Scanner scan2 = new Scanner(System.in); scan2 new Scanner(System.in) int ak = 0 ak 0 bk = 0; bk 0 int a a b b j j w w u; u int kai = scan.nextInt(); kai scan.nextInt() scan.nextInt scan for(int i=0; i<kai; i++){
		String stra = scan.next();
		String strb = scan.next();
		
		char[] A = stra.toCharArray();
		char[] B = strb.toCharArray();
		
		int x = 0;
		int c = 0;
		
		for(j=0; j<A.length; j++){}
		for(w=0; w<B.length; w++){}
		
		if(j < w){
			u = j;}
		else{
			u = w;}
		
		for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}}

			if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}}} int i=0; int i=0; i 0 i<kai i kai i++ i++ i {
		String stra = scan.next();
		String strb = scan.next();
		
		char[] A = stra.toCharArray();
		char[] B = strb.toCharArray();
		
		int x = 0;
		int c = 0;
		
		for(j=0; j<A.length; j++){}
		for(w=0; w<B.length; w++){}
		
		if(j < w){
			u = j;}
		else{
			u = w;}
		
		for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}}

			if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}}} {
		String stra = scan.next();
		String strb = scan.next();
		
		char[] A = stra.toCharArray();
		char[] B = strb.toCharArray();
		
		int x = 0;
		int c = 0;
		
		for(j=0; j<A.length; j++){}
		for(w=0; w<B.length; w++){}
		
		if(j < w){
			u = j;}
		else{
			u = w;}
		
		for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}}

			if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}}} String stra = scan.next(); stra scan.next() scan.next scan String strb = scan.next(); strb scan.next() scan.next scan char[] A = stra.toCharArray(); A stra.toCharArray() stra.toCharArray stra char[] B = strb.toCharArray(); B strb.toCharArray() strb.toCharArray strb int x = 0; x 0 int c = 0; c 0 for(j=0; j<A.length; j++){} j=0; j=0 j 0 j<A.length j A.length A A.length j++ j++ j {} {} for(w=0; w<B.length; w++){} w=0; w=0 w 0 w<B.length w B.length B B.length w++ w++ w {} {} if(j < w){
			u = j;}
		else{
			u = w;} j < w j w {
			u = j;} u = j u j {
			u = w;} u = w u w for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}} int q=0; int q=0; q 0 q<u q u q++ q++ q {
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}} {
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}} a = A[q] a A[q] A q b = B[q] b B[q] B q if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;} a < b a b {
				bk += 3;
				c = 1;
				break;} bk += 3 bk 3 c = 1 c 1 break; if(a > b){
				ak += 3;
				c = 1;
				break;} a > b a b {
				ak += 3;
				c = 1;
				break;} ak += 3 ak 3 c = 1 c 1 break; if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}} c == 0 c 0 {
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}} if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;} j == w j w {
					ak++;	bk++;} ak++ ak bk++ bk if(j > w){
					ak += 3;}
				else{
					bk += 3;} j > w j w {
					ak += 3;} ak += 3 ak 3 {
					bk += 3;} bk += 3 bk 3 System.out.println(ak+" "+bk) System.out.println System.out System System.out ak+" "+bk ak+" "+bk ak " " bk String[] args args
import java.util.Scanner;

class Main
{
	public static void main(String[] args){
	
		Scanner scan = new Scanner(System.in);
		Scanner scan2 = new Scanner(System.in);
	
	int ak = 0, bk = 0;
	int a, b, j, w, u;
	
	int kai = scan.nextInt();
	
	for(int i=0; i<kai; i++){
		String stra = scan.next();
		String strb = scan.next();
		
		char[] A = stra.toCharArray();
		char[] B = strb.toCharArray();
		
		int x = 0;
		int c = 0;
		
		for(j=0; j<A.length; j++){}
		for(w=0; w<B.length; w++){}
		
		if(j < w){
			u = j;}
		else{
			u = w;}
		
		for(int q=0; q<u; q++){
			a = A[q];
			b = B[q];
			
			if(a < b){
				bk += 3;
				c = 1;
				break;}
			else if(a > b){
				ak += 3;
				c = 1;
				break;}}

			if(c == 0){
				if(j == w){
					ak++;	bk++;}
				else if(j > w){
					ak += 3;}
				else{
					bk += 3;}}}
				
		System.out.println(ak+" "+bk);
	}
}
