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

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

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

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

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

n = A("n")
m = B("m")
f = C("f")
c = D("c")
d = E("d")
i = E("i")

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

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

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

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

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

n = A("n")
m = B("m")
f = C("f")
c = D("c")
d = E("d")
i = E("i")

n.z = m
n.r = c
n.y = f
m.o = f
f.p = c
f.s = c
c.v = m
c.o = f
c.p = d
d.u = n
i.u = n
assert i.u.z.o.p.txt == "c"