class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.o: C = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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