class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.z: D = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

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

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

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

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

k = A("k")
i = B("i")
m = C("m")
n = D("n")
e = E("e")
j = C("j")
a = A("a")

k.w = i
k.r = i
k.x = a
k.p = a
k.z = n
i.q = n
m.r = e
m.y = n
m.z = k
m.q = j
m.o = j
n.o = a
n.u = e
e.r = a
e.y = j
e.o = i
j.r = e
j.y = n
j.z = k
j.q = m
j.o = m
a.w = i
a.r = i
a.x = k
a.p = k
a.z = n
assert i.q.u.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.z: D = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

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

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

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

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

k = A("k")
i = B("i")
m = C("m")
n = D("n")
e = E("e")
j = C("j")
a = A("a")

k.w = i
k.r = i
k.x = a
k.p = a
k.z = n
i.q = n
m.r = e
m.y = n
m.z = k
m.q = j
m.o = j
n.o = a
n.u = e
e.r = a
e.y = j
e.o = i
j.r = e
j.y = n
j.z = k
j.q = m
j.o = m
a.w = i
a.r = i
a.x = k
a.p = k
a.z = n
assert i.q.u.o.q.txt == "n"