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

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

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

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

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

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

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

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

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

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

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

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

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