import java.io.*;
public class Num2
{
public static void main(String[]args)throws IOException
{
BufferedReader a=new BufferedReader(new InputStreamReader(System.in));
int r1, c1, r2, c2;
int[][]cards;
cards=new int[4][4];
for(int r=0; r<4; r++)
{
for(int c=0; c<4; c++)
{
cards[r][c]=(int) (Math.random() * 8);
System.out.print(cards[r][c]);
}
System.out.print("\n");
}
for (int r=0; r<4; r++)
{
for (int c=0; c<4; c++)
{
System.out.print("*");
}
System.out.print("\n");
}
System.out.print("\nPlease insert the first card row.");
r1=Integer.parseInt(a.readLine());
System.out.print("\nPlease insert the first card column.");
c1=Integer.parseInt(a.readLine());
System.out.print("\nPlease insert the second card row.");
r2=Integer.parseInt(a.readLine());
System.out.print("\nPlease insert the first card column.");
c2=Integer.parseInt(a.readLine());
//reveal
for(int r=0; r<4; r++)
{
for (int c=0; c<4; c++)
{
if((r==r1)&&(c==c1))
{
System.out.print(cards[r][c]);
}
else if((r==r2)&&(c==c2))
{
System.out.print(cards[r][c]);
}
else
{
System.out.print("*");
}
}
//match?
if (cards[r1][c1]==cards[r2][c2])
{
}
else
{
}
}
}
}