class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

h.w = k
h.x = j
h.q = b
d.r = j
d.t = k
d.z = h
d.y = e
d.u = e
b.q = j
b.x = j
f.s = e
k.y = l
k.p = h
k.v = b
k.x = a
j.s = e
e.r = j
e.t = k
e.z = h
e.y = d
e.u = l
l.r = f
l.t = k
l.z = h
l.y = d
l.u = d
a.y = e
a.p = h
a.v = b
a.x = k
assert d.z.q.x.s.y.t.y.y.t.txt == "k"