public class Info
{
char at []; public Info()
{
at =  new char[30];
}

public static void main(String s[])
{
Info info = new Info();
Push push = new Push(info);
Pop pop = new Pop(info);
Thread t1 = new Thread(push);
Thread t2 = new Thread(pop);

t1.start();
t2.start();
}
};class Push implements Runnable
{
Info info; public Push(Info info)
{
this.info = info;
}
public void run()
{
for(int i=66,j=0; i<80; i++,j++)
{
info.at[j] = (char)i;

}
}
};class Pop implements Runnable
{
Info info; public Pop(Info info)
{
this.info = info;
}
public void run()
{
for(int j=0; j<info.at.length;j++)
{
System.out.println(info.at[j]);
try{
Thread.sleep(10000);
}catch(Exception e){e.printStackTrace();}
}
}
};