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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.q: F = None
        self.o: A = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.q: F = None
        self.o: A = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

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

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

e.z = g
m.t = f
m.w = k
m.q = g
m.o = e
m.x = h
f.y = e
f.x = m
f.r = g
h.s = m
h.w = b
b.v = h
b.u = m
b.q = f
b.s = f
b.y = e
g.x = b
g.u = f
j.s = k
j.w = b
k.t = f
k.w = m
k.q = g
k.o = e
k.x = j
assert h.w.y.z.x.txt == "b"