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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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

m = A("m")
j = B("j")
d = C("d")
h = D("h")
c = E("c")
b = F("b")

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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

m = A("m")
j = B("j")
d = C("d")
h = D("h")
c = E("c")
b = F("b")

m.z = j
m.o = j
m.u = b
m.r = d
j.u = m
j.o = c
d.t = b
h.o = j
h.u = j
h.q = d
h.x = b
h.w = c
c.z = j
c.r = m
c.q = d
c.v = d
c.y = d
c.s = h
b.r = j
assert h.w.v.t.txt == "b"