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

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

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

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

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

k = A("k")
h = B("h")
n = C("n")
d = D("d")
l = E("l")

k.v = l
k.o = l
k.t = d
h.z = n
h.t = l
h.o = d
h.r = k
n.z = h
n.x = k
n.y = d
d.p = l
l.t = n
l.x = h
l.z = d
assert h.t.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

k = A("k")
h = B("h")
n = C("n")
d = D("d")
l = E("l")

k.v = l
k.o = l
k.t = d
h.z = n
h.t = l
h.o = d
h.r = k
n.z = h
n.x = k
n.y = d
d.p = l
l.t = n
l.x = h
l.z = d
assert h.t.z.p.txt == "l"