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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.q: C = None
        self.u: A = None
        self.z: B = None
        self.p: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.r: E = None
        self.y: D = None
        self.u: C = None
        self.t: F = None
        self.txt = txt

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

d.p = e
d.r = m
d.z = h
d.s = i
h.s = i
h.z = i
h.p = i
h.t = e
h.q = e
h.u = d
e.t = m
e.w = d
e.x = k
f.x = d
f.q = c
m.p = d
k.p = e
k.q = e
k.u = e
k.r = m
k.y = b
k.t = c
c.p = e
c.q = e
c.u = e
c.r = m
c.y = b
c.t = k
i.s = h
i.z = h
i.p = h
i.t = e
i.q = e
i.u = d
b.x = d
b.q = c
assert m.p.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: E = None
        self.z: B = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.q: C = None
        self.u: A = None
        self.z: B = None
        self.p: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.r: E = None
        self.y: D = None
        self.u: C = None
        self.t: F = None
        self.txt = txt

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

d.p = e
d.r = m
d.z = h
d.s = i
h.s = i
h.z = i
h.p = i
h.t = e
h.q = e
h.u = d
e.t = m
e.w = d
e.x = k
f.x = d
f.q = c
m.p = d
k.p = e
k.q = e
k.u = e
k.r = m
k.y = b
k.t = c
c.p = e
c.q = e
c.u = e
c.r = m
c.y = b
c.t = k
i.s = h
i.z = h
i.p = h
i.t = e
i.q = e
i.u = d
b.x = d
b.q = c
assert m.p.z.q.txt == "e"