class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: B = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: F = None
        self.t: E = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

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

b = A("b")
m = B("m")
f = C("f")
h = D("h")
c = E("c")
l = F("l")
g = C("g")

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: F = None
        self.t: E = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

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

b = A("b")
m = B("m")
f = C("f")
h = D("h")
c = E("c")
l = F("l")
g = C("g")

b.q = g
b.v = m
b.t = m
b.u = h
m.w = c
m.t = c
m.u = l
m.v = l
f.u = c
f.y = h
f.z = l
h.v = m
h.y = m
h.t = c
h.o = l
c.x = l
c.y = h
c.z = f
l.z = m
g.u = c
g.y = h
g.z = l
assert c.z.z.z.v.z.u.txt == "l"