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

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

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

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

k = A("k")
j = B("j")
m = C("m")
e = D("e")
n = B("n")
c = D("c")
a = D("a")
l = C("l")
d = C("d")

k.z = j
k.w = n
j.s = n
j.t = e
j.o = e
j.p = k
m.p = k
e.u = j
e.x = m
e.v = n
n.s = j
n.t = e
n.p = k
n.o = c
c.u = n
c.v = n
c.x = m
a.u = j
a.v = j
a.x = l
l.p = k
d.p = k
assert c.u.s.s.s.p.w.s.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.txt = txt

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

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

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

k = A("k")
j = B("j")
m = C("m")
e = D("e")
n = B("n")
c = D("c")
a = D("a")
l = C("l")
d = C("d")

k.z = j
k.w = n
j.s = n
j.t = e
j.o = e
j.p = k
m.p = k
e.u = j
e.x = m
e.v = n
n.s = j
n.t = e
n.p = k
n.o = c
c.u = n
c.v = n
c.x = m
a.u = j
a.v = j
a.x = l
l.p = k
d.p = k
assert c.u.s.s.s.p.w.s.p.w.txt == "n"