class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

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

a.r = h
e.y = f
e.z = h
e.o = i
k.t = h
k.w = h
f.x = e
l.p = h
l.x = f
h.p = l
h.x = f
i.t = h
i.w = l
assert f.x.o.t.p.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

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

a.r = h
e.y = f
e.z = h
e.o = i
k.t = h
k.w = h
f.x = e
l.p = h
l.x = f
h.p = l
h.x = f
i.t = h
i.w = l
assert f.x.o.t.p.x.x.txt == "e"