class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

h = A("h")
e = B("e")
n = C("n")
b = B("b")
i = C("i")

h.y = b
h.t = b
e.u = h
e.o = i
n.u = h
b.u = h
b.o = n
i.u = h
assert e.u.y.o.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

h = A("h")
e = B("e")
n = C("n")
b = B("b")
i = C("i")

h.y = b
h.t = b
e.u = h
e.o = i
n.u = h
b.u = h
b.o = n
i.u = h
assert e.u.y.o.u.y.txt == "b"