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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.w: C = None
        self.y: D = None
        self.p: D = None
        self.txt = txt

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

n = A("n")
c = B("c")
i = C("i")
l = D("l")
m = E("m")
a = F("a")
j = C("j")
b = C("b")

n.w = c
n.p = c
n.q = c
n.z = m
n.y = b
n.t = j
c.s = n
i.v = m
i.y = c
l.z = a
m.v = a
m.s = l
m.y = l
m.p = l
m.w = b
a.s = m
a.v = m
j.v = m
j.y = c
b.v = m
b.y = c
assert n.z.w.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.z: E = None
        self.y: C = None
        self.q: B = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.w: C = None
        self.y: D = None
        self.p: D = None
        self.txt = txt

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

n = A("n")
c = B("c")
i = C("i")
l = D("l")
m = E("m")
a = F("a")
j = C("j")
b = C("b")

n.w = c
n.p = c
n.q = c
n.z = m
n.y = b
n.t = j
c.s = n
i.v = m
i.y = c
l.z = a
m.v = a
m.s = l
m.y = l
m.p = l
m.w = b
a.s = m
a.v = m
j.v = m
j.y = c
b.v = m
b.y = c
assert n.z.w.v.v.v.txt == "m"