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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.v: D = None
        self.s: E = None
        self.u: D = None
        self.txt = txt

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

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

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

k.z = l
k.v = a
k.t = a
k.y = m
c.z = a
a.z = f
a.q = m
a.v = e
a.u = e
a.s = j
e.p = l
j.t = f
j.r = l
j.v = c
j.u = a
h.z = f
h.u = f
h.q = m
h.v = e
h.s = j
m.z = a
l.z = k
l.v = h
l.t = h
l.y = c
f.p = k
assert h.q.z.q.z.s.t.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.y: B = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.v: D = None
        self.s: E = None
        self.u: D = None
        self.txt = txt

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

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

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

k.z = l
k.v = a
k.t = a
k.y = m
c.z = a
a.z = f
a.q = m
a.v = e
a.u = e
a.s = j
e.p = l
j.t = f
j.r = l
j.v = c
j.u = a
h.z = f
h.u = f
h.q = m
h.v = e
h.s = j
m.z = a
l.z = k
l.v = h
l.t = h
l.y = c
f.p = k
assert h.q.z.q.z.s.t.p.y.txt == "m"