/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
static class MyClass<M extends MyClass<M>> {
    int i = 0;

    public M self() {
      return (M) this;
    }

    public M increment() {
        i++;
        return self();
    }
}

static class MySubClass extends MyClass<MySubClass> { }

	
	public static void main (String[] args) throws java.lang.Exception
	{
		MySubClass m = new MySubClass().increment();
	}
}