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

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

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

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

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

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

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

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

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

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

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