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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: F = None
        self.p: G = None
        self.r: E = None
        self.o: E = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: F = None
        self.p: C = None
        self.u: A = None
        self.r: G = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: F = None
        self.p: G = None
        self.r: E = None
        self.o: E = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: F = None
        self.p: C = None
        self.u: A = None
        self.r: G = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

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

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