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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

h = A("h")
n = B("n")
l = C("l")
i = D("i")
c = E("c")
j = A("j")
k = E("k")

h.t = i
h.u = i
h.v = n
h.r = j
h.z = l
n.y = h
n.v = j
n.z = l
l.s = i
i.t = h
i.o = n
i.u = c
c.t = h
c.q = n
j.t = i
j.u = i
j.v = n
j.r = h
j.z = l
k.t = h
k.q = n
assert j.t.o.v.r.r.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: B = None
        self.u: D = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

h = A("h")
n = B("n")
l = C("l")
i = D("i")
c = E("c")
j = A("j")
k = E("k")

h.t = i
h.u = i
h.v = n
h.r = j
h.z = l
n.y = h
n.v = j
n.z = l
l.s = i
i.t = h
i.o = n
i.u = c
c.t = h
c.q = n
j.t = i
j.u = i
j.v = n
j.r = h
j.z = l
k.t = h
k.q = n
assert j.t.o.v.r.r.r.z.txt == "l"