import java.util.*;
import java.lang.*;
import java.io.*;
abstract class A {
public void coucou(){
System.
out.
println("Je suis A"); }
}
class B extends A {
@Override
public void coucou(){
System.
out.
println("Je suis B"); }
}
class C extends A {
@Override
public void coucou(){
System.
out.
println("Je suis C"); }
}
class UneClasse {
public void uneMethode(A a){
System.
out.
println("Signature (A) : "); a.coucou();
}
public void uneMethode(B a){
System.
out.
println("Signature (B) : "); a.coucou();
}
}
class Ideone {
UneClasse c = new UneClasse();
c.uneMethode(new A(){});
B a1 = new B();
c.uneMethode(a1);
C a2 = new C();
c.uneMethode(a2);
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgphYnN0cmFjdCBjbGFzcyBBIHsKICAgIHB1YmxpYyB2b2lkIGNvdWNvdSgpewogICAgCVN5c3RlbS5vdXQucHJpbnRsbigiSmUgc3VpcyBBIik7CiAgICB9CQp9CgpjbGFzcyBCIGV4dGVuZHMgQSB7CglAT3ZlcnJpZGUKICAgIHB1YmxpYyB2b2lkIGNvdWNvdSgpewogICAgCVN5c3RlbS5vdXQucHJpbnRsbigiSmUgc3VpcyBCIik7CiAgICB9CQp9CgpjbGFzcyBDIGV4dGVuZHMgQSB7CglAT3ZlcnJpZGUKICAgIHB1YmxpYyB2b2lkIGNvdWNvdSgpewogICAgCVN5c3RlbS5vdXQucHJpbnRsbigiSmUgc3VpcyBDIik7CiAgICB9CQp9CgpjbGFzcyBVbmVDbGFzc2UgewoJcHVibGljIHZvaWQgdW5lTWV0aG9kZShBIGEpewoJCVN5c3RlbS5vdXQucHJpbnRsbigiU2lnbmF0dXJlIChBKSA6ICIpOwoJCWEuY291Y291KCk7Cgl9CgkKCXB1YmxpYyB2b2lkIHVuZU1ldGhvZGUoQiBhKXsKCQlTeXN0ZW0ub3V0LnByaW50bG4oIlNpZ25hdHVyZSAoQikgOiAiKTsKCQlhLmNvdWNvdSgpOwoJfQp9CgpjbGFzcyBJZGVvb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