class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.y: C = None
        self.w: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

e = A("e")
j = B("j")
m = C("m")
h = D("h")
a = E("a")
i = F("i")
b = D("b")
d = B("d")

e.z = m
e.v = m
j.z = d
j.w = d
j.p = e
j.y = m
j.t = m
m.z = i
h.z = m
h.q = a
a.r = b
a.x = m
i.q = a
i.z = h
i.v = d
b.z = m
b.q = a
d.z = j
d.w = j
d.p = e
d.y = m
d.t = m
assert h.z.z.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.y: C = None
        self.w: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

e = A("e")
j = B("j")
m = C("m")
h = D("h")
a = E("a")
i = F("i")
b = D("b")
d = B("d")

e.z = m
e.v = m
j.z = d
j.w = d
j.p = e
j.y = m
j.t = m
m.z = i
h.z = m
h.q = a
a.r = b
a.x = m
i.q = a
i.z = h
i.v = d
b.z = m
b.q = a
d.z = j
d.w = j
d.p = e
d.y = m
d.t = m
assert h.z.z.v.p.txt == "e"