
public class Date {

  private int year;
  private int month;
  private int day;

  public Date(int d, int m, int y) {
  	this.year = y;
  	this.month = m;
  	this.day = d;
  } 
  public int Day() {
  	return this.day;
  }
  public int Month() {
  	return this.month;
  }
  public int Year() {
  	return this.year;
  }
  public void Lendemain() {
  	int monthinyear = 12;
  	int[] dayinmonth = {31, 28, 31, 30, 31, 30,
  						31, 31, 30, 31, 30, 31};

  	if (this.day == dayinmonth[this.month-1]) {
  		this.day = 1;
  		this.month += 1;
  		if (this.month > monthinyear) {
  			this.month = 1;
  			this.year +=1;
  		}

  	} else {
  		this.day += 1;
  	}

  }
  public String toString() {
  	int i;
  	String sday = Integer.toString(this.day);
  	String smonth = Integer.toString(this.month);
  	String syear = Integer.toString(this.year);
  	if (sday.length() < 2) {
  		for (i = 0; i<2-sday.length(); i++) {
  			sday = "0"+sday;
  		}
  	}
  	if (smonth.length() < 2) {
  		for (i = 0; i<2-smonth.length(); i++) {
  			smonth = "0"+smonth;
  		}
  	}
  	if (syear.length() < 4) {
  		for (i = 0; i<4-syear.length(); i++) {
  			syear = "0"+syear;
  		}
  	}
    return syear+"-"+smonth+"-"+sday;
  }
}