class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.o: B = None
        self.p: F = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

n.r = b
n.s = l
n.o = l
n.p = d
n.v = c
l.z = b
b.r = c
c.z = b
c.s = m
c.o = d
m.z = l
m.w = l
m.r = l
m.s = d
m.p = b
d.s = b
d.w = b
i.r = b
i.s = l
i.o = l
i.p = d
i.v = c
assert n.p.s.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.o: B = None
        self.p: F = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

n.r = b
n.s = l
n.o = l
n.p = d
n.v = c
l.z = b
b.r = c
c.z = b
c.s = m
c.o = d
m.z = l
m.w = l
m.r = l
m.s = d
m.p = b
d.s = b
d.w = b
i.r = b
i.s = l
i.o = l
i.p = d
i.v = c
assert n.p.s.r.s.txt == "m"