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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: D = None
        self.q: C = None
        self.w: D = None
        self.x: B = None
        self.txt = txt

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

j.z = n
j.p = n
j.v = n
j.u = n
j.x = l
m.v = i
n.v = d
n.q = h
n.x = m
d.p = i
d.y = j
i.o = n
i.q = n
i.r = d
i.w = d
i.x = m
l.z = n
l.p = n
l.v = n
l.u = n
l.x = j
h.z = n
h.p = n
h.v = n
h.u = n
h.x = l
assert l.u.x.v.x.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: C = None
        self.v: C = None
        self.x: A = None
        self.u: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: D = None
        self.q: C = None
        self.w: D = None
        self.x: B = None
        self.txt = txt

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

j.z = n
j.p = n
j.v = n
j.u = n
j.x = l
m.v = i
n.v = d
n.q = h
n.x = m
d.p = i
d.y = j
i.o = n
i.q = n
i.r = d
i.w = d
i.x = m
l.z = n
l.p = n
l.v = n
l.u = n
l.x = j
h.z = n
h.p = n
h.v = n
h.u = n
h.x = l
assert l.u.x.v.x.v.w.txt == "d"