import java.util.*;
import java.io.*;

public class brain
{	public static void main(String[] args) throws FileNotFoundException
	{	Scanner s = new Scanner( new File("brain.in") );
		int numSets = ( Integer.parseInt( s.nextLine() ) );
		for(int i = 0; i < numSets; i++)
		{	String p1 = s.nextLine();
			String p2 = s.nextLine();
			String result = "";
			for(int j = 0; j < 18; j++)
			{	if( p1.charAt(j) == p2.charAt(j) )
				{	result += p1.charAt(j);
				}
				else
				{	result += "*";
				}
			}
			System.out.println( result );
		}

	}

}