import java.io.*;

public class Thread_bsp2 {
   private static void pause() {
    try {
      System.in.read();
    }
    catch (IOException e) {
    }
  }  // pause

  public static void main(String[] args) {
    myThread t1,t2;
    long summe=0;
    t1=new myThread(100,true);
    t2=new myThread(100,false);
    t1.start();
    t2.start();
    try {
      t1.join();
      t2.join();
    }
    catch (InterruptedException e) {
    }
    System.out.println(t1.getSumme());
    System.out.println(t2.getSumme());
    long s=t1.getSumme()+t2.getSumme();
    System.out.println(s);
    pause();

  }

}
class myThread extends Thread {
  int _n;
  boolean _bOdd;
  long _summe;
  public myThread (int n, boolean bOdd) {
    _n = n;
    _bOdd = bOdd;
  } // create

  long getSumme()     {
    return _summe;
  }

  // Thread-Methode
  public void run() {
    _summe=0;
    long iStart;
    if (_bOdd)
      iStart = 1;
    else
      iStart=2;
    for (long i=iStart; i<=_n; i+=2) {
        _summe+=2*i+3;
        //System.out.println(_bOdd);
        try {
           Thread.sleep( 10 );
        } catch (InterruptedException e) {
        }
    }
  }


}  // myThread

