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

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

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

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

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

h = A("h")
i = B("i")
f = C("f")
j = D("j")
a = E("a")
l = E("l")
e = A("e")
d = A("d")
k = A("k")

h.u = j
h.o = i
i.u = l
f.z = j
j.p = f
a.v = j
l.v = j
e.u = j
e.o = i
d.u = j
d.o = i
k.u = j
k.o = i
assert e.o.u.v.p.z.p.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

h = A("h")
i = B("i")
f = C("f")
j = D("j")
a = E("a")
l = E("l")
e = A("e")
d = A("d")
k = A("k")

h.u = j
h.o = i
i.u = l
f.z = j
j.p = f
a.v = j
l.v = j
e.u = j
e.o = i
d.u = j
d.o = i
k.u = j
k.o = i
assert e.o.u.v.p.z.p.z.p.txt == "f"