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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.y: B = None
        self.q: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.z: A = None
        self.u: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.y: B = None
        self.q: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.z: A = None
        self.u: C = None
        self.txt = txt

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

i.w = m
i.s = n
i.o = n
k.z = e
k.p = e
k.s = n
m.t = k
m.w = c
m.y = c
m.q = j
n.v = e
n.x = c
n.z = i
n.u = m
j.t = c
j.w = c
j.y = c
j.q = m
c.z = i
c.p = i
c.s = n
e.w = j
e.s = n
e.o = n
assert e.w.q.q.y.s.txt == "n"