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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

b = A("b")
a = B("a")
g = C("g")
e = C("e")
c = C("c")
h = A("h")
i = C("i")

b.t = a
b.o = c
b.s = c
a.y = g
a.z = g
g.u = b
g.p = h
e.u = h
e.p = b
c.u = b
c.p = b
h.t = a
h.o = i
h.s = c
i.u = h
i.p = h
assert b.t.y.u.t.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

b = A("b")
a = B("a")
g = C("g")
e = C("e")
c = C("c")
h = A("h")
i = C("i")

b.t = a
b.o = c
b.s = c
a.y = g
a.z = g
g.u = b
g.p = h
e.u = h
e.p = b
c.u = b
c.p = b
h.t = a
h.o = i
h.s = c
i.u = h
i.p = h
assert b.t.y.u.t.y.u.txt == "b"