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

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

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

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

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

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

a.w = k
a.v = e
h.z = j
h.o = a
h.y = k
h.u = d
j.v = k
j.p = d
d.r = k
d.s = a
d.y = a
d.q = h
d.u = j
k.z = e
e.z = j
e.o = a
e.y = k
e.u = d
assert j.p.q.y.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

a.w = k
a.v = e
h.z = j
h.o = a
h.y = k
h.u = d
j.v = k
j.p = d
d.r = k
d.s = a
d.y = a
d.q = h
d.u = j
k.z = e
e.z = j
e.o = a
e.y = k
e.u = d
assert j.p.q.y.z.z.txt == "j"