class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

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

b = A("b")
m = B("m")
h = C("h")
g = B("g")
c = C("c")
j = C("j")
e = B("e")
n = C("n")
f = A("f")

b.w = c
b.x = c
b.v = e
m.t = b
m.u = g
m.z = f
h.o = g
g.t = f
g.z = f
g.u = m
c.o = e
j.o = g
e.t = b
e.z = b
e.u = g
n.o = g
f.w = h
f.v = g
f.x = j
assert g.u.t.x.o.u.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

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

b = A("b")
m = B("m")
h = C("h")
g = B("g")
c = C("c")
j = C("j")
e = B("e")
n = C("n")
f = A("f")

b.w = c
b.x = c
b.v = e
m.t = b
m.u = g
m.z = f
h.o = g
g.t = f
g.z = f
g.u = m
c.o = e
j.o = g
e.t = b
e.z = b
e.u = g
n.o = g
f.w = h
f.v = g
f.x = j
assert g.u.t.x.o.u.u.z.txt == "f"