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

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

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

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

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

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

k.z = j
k.u = f
k.o = e
l.x = e
j.s = m
j.v = d
j.y = d
j.x = f
m.r = l
m.v = f
h.p = f
d.s = f
d.v = j
d.y = j
d.x = m
f.r = l
f.v = m
e.p = f
assert f.r.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

k.z = j
k.u = f
k.o = e
l.x = e
j.s = m
j.v = d
j.y = d
j.x = f
m.r = l
m.v = f
h.p = f
d.s = f
d.v = j
d.y = j
d.x = m
f.r = l
f.v = m
e.p = f
assert f.r.x.p.txt == "f"