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

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

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

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

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

e = A("e")
d = B("d")
c = C("c")
n = D("n")
l = E("l")
f = A("f")
h = B("h")
k = D("k")

e.z = l
e.x = c
e.p = c
d.v = h
d.p = h
d.y = c
d.s = f
c.w = e
n.v = k
n.p = l
n.s = h
n.o = f
l.p = f
l.z = c
f.z = l
f.x = c
f.p = c
h.v = d
h.p = d
h.y = c
h.s = f
k.v = n
k.p = l
k.s = h
k.o = f
assert l.p.z.z.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

e = A("e")
d = B("d")
c = C("c")
n = D("n")
l = E("l")
f = A("f")
h = B("h")
k = D("k")

e.z = l
e.x = c
e.p = c
d.v = h
d.p = h
d.y = c
d.s = f
c.w = e
n.v = k
n.p = l
n.s = h
n.o = f
l.p = f
l.z = c
f.z = l
f.x = c
f.p = c
h.v = d
h.p = d
h.y = c
h.s = f
k.v = n
k.p = l
k.s = h
k.o = f
assert l.p.z.z.w.z.txt == "l"