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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.y: B = None
        self.txt = txt

j = A("j")
l = B("l")
i = C("i")
m = D("m")
c = E("c")
e = A("e")
n = A("n")
f = C("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.y: B = None
        self.txt = txt

j = A("j")
l = B("l")
i = C("i")
m = D("m")
c = E("c")
e = A("e")
n = A("n")
f = C("f")

j.w = i
j.r = m
j.v = m
j.s = f
l.w = c
l.p = c
i.o = c
i.u = l
m.x = l
m.u = l
c.s = m
c.z = l
c.y = l
e.w = f
e.s = f
e.r = m
e.v = m
n.w = f
n.s = f
n.r = m
n.v = m
f.o = c
f.u = l
assert c.s.x.p.y.p.z.txt == "l"