using System;
public interface Foo
{
Foo foo();
}
class Foo_int : Foo
{
private int content = 0;
public Foo_int(int content)
{
this.content = content;
}
public Foo foo()
{
return new Foo_int(content + 1);
}
public override string ToString()
{
return content.ToString();
}
}
public class Test
{
public static Foo bar(Foo x)
{
return x.foo();
}
public static void Main()
{
var x = new Foo_int(1);
Console.WriteLine(bar(x));
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGludGVyZmFjZSBGb28KewogICAgRm9vIGZvbygpOwp9CgpjbGFzcyBGb29faW50IDogRm9vCnsKICAgIHByaXZhdGUgaW50IGNvbnRlbnQgPSAwOwogICAgCiAgICBwdWJsaWMgRm9vX2ludChpbnQgY29udGVudCkKICAgIHsKICAgICAgICB0aGlzLmNvbnRlbnQgPSBjb250ZW50OwogICAgfQogICAgCiAgICBwdWJsaWMgRm9vIGZvbygpCiAgICB7CiAgICAgICAgcmV0dXJuIG5ldyBGb29faW50KGNvbnRlbnQgKyAxKTsKICAgIH0KICAgIAogICAgcHVibGljIG92ZXJyaWRlIHN0cmluZyBUb1N0cmluZygpCiAgICB7CiAgICAgICAgcmV0dXJuIGNvbnRlbnQuVG9TdHJpbmcoKTsKICAgIH0KfQoKcHVibGljIGNsYXNzIFRlc3QKewogICAgcHVibGljIHN0YXRpYyBGb28gYmFyKEZvbyB4KQogICAgewogICAgICAgIHJldHVybiB4LmZvbygpOwogICAgfQogICAgCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCiAgICB7CiAgICAgICAgdmFyIHggPSBuZXcgRm9vX2ludCgxKTsKICAgICAgICBDb25zb2xlLldyaXRlTGluZShiYXIoeCkpOwogICAgfQp9