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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.u: D = None
        self.w: C = None
        self.q: D = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.s: H = None
        self.w: H = None
        self.q: G = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: H = None
        self.r: D = None
        self.t: A = None
        self.y: B = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: F = None
        self.s: E = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

b = A("b")
k = B("k")
c = C("c")
e = D("e")
n = E("n")
j = F("j")
i = G("i")
m = H("m")

b.q = n
k.v = i
k.s = j
k.z = j
k.u = e
k.q = e
k.w = c
c.z = i
c.q = i
c.t = k
c.s = m
c.w = m
c.o = b
e.u = c
e.s = k
e.v = i
n.r = j
n.v = i
j.z = n
j.q = m
j.r = e
j.t = b
j.y = k
j.u = k
i.u = m
i.v = j
i.s = n
i.z = c
m.p = b
assert m.p.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.u: D = None
        self.w: C = None
        self.q: D = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.s: H = None
        self.w: H = None
        self.q: G = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: H = None
        self.r: D = None
        self.t: A = None
        self.y: B = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: F = None
        self.s: E = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

b = A("b")
k = B("k")
c = C("c")
e = D("e")
n = E("n")
j = F("j")
i = G("i")
m = H("m")

b.q = n
k.v = i
k.s = j
k.z = j
k.u = e
k.q = e
k.w = c
c.z = i
c.q = i
c.t = k
c.s = m
c.w = m
c.o = b
e.u = c
e.s = k
e.v = i
n.r = j
n.v = i
j.z = n
j.q = m
j.r = e
j.t = b
j.y = k
j.u = k
i.u = m
i.v = j
i.s = n
i.z = c
m.p = b
assert m.p.q.r.txt == "j"