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

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

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

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

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

h = A("h")
l = B("l")
b = C("b")
j = D("j")
n = E("n")
m = A("m")
e = C("e")
d = B("d")

h.x = m
h.p = m
l.v = n
l.p = n
l.x = b
l.z = j
b.x = l
j.v = e
j.x = e
n.x = j
n.s = e
n.v = b
n.o = l
n.u = d
m.x = h
m.p = h
e.x = l
d.v = n
d.p = n
d.x = b
d.z = j
assert b.x.z.v.x.x.x.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

h = A("h")
l = B("l")
b = C("b")
j = D("j")
n = E("n")
m = A("m")
e = C("e")
d = B("d")

h.x = m
h.p = m
l.v = n
l.p = n
l.x = b
l.z = j
b.x = l
j.v = e
j.x = e
n.x = j
n.s = e
n.v = b
n.o = l
n.u = d
m.x = h
m.p = h
e.x = l
d.v = n
d.p = n
d.x = b
d.z = j
assert b.x.z.v.x.x.x.z.v.txt == "e"