class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.r: E = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

m = A("m")
d = B("d")
l = C("l")
g = D("g")
c = E("c")
e = F("e")
h = C("h")

m.z = d
m.s = d
m.x = d
m.r = c
d.r = e
d.v = m
l.w = g
g.u = e
g.r = d
c.y = h
c.q = m
c.t = m
c.v = g
e.o = g
e.p = g
e.z = c
e.x = c
h.w = g
assert h.w.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.r: E = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

m = A("m")
d = B("d")
l = C("l")
g = D("g")
c = E("c")
e = F("e")
h = C("h")

m.z = d
m.s = d
m.x = d
m.r = c
d.r = e
d.v = m
l.w = g
g.u = e
g.r = d
c.y = h
c.q = m
c.t = m
c.v = g
e.o = g
e.p = g
e.z = c
e.x = c
h.w = g
assert h.w.u.x.txt == "c"