class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: A = None
        self.o: A = None
        self.q: F = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.txt = txt

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

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

l.x = m
h.r = g
h.z = m
c.w = m
c.u = b
k.p = l
k.w = l
k.o = l
k.q = g
k.s = j
k.z = j
j.r = k
j.y = k
m.w = h
m.v = l
m.o = l
g.w = b
g.v = l
g.o = l
b.r = g
b.z = m
assert k.s.r.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: A = None
        self.o: A = None
        self.q: F = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.txt = txt

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

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

l.x = m
h.r = g
h.z = m
c.w = m
c.u = b
k.p = l
k.w = l
k.o = l
k.q = g
k.s = j
k.z = j
j.r = k
j.y = k
m.w = h
m.v = l
m.o = l
g.w = b
g.v = l
g.o = l
b.r = g
b.z = m
assert k.s.r.w.x.txt == "m"