class A {
public static void main(String[] args) {
A a = new A();
new MT("-",a).start();
new MT("-------",a).start();
}}
class MT extends Thread {
  Object o;
  String str;
  public MT(String str, Object o) {
  this.str = str;
  this.o = o;
  }
  public void run() {
  while(true) {
 synchronized(o) {
System.out.println(str);
o.notify();
 }
  }
  }
}