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

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

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

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

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

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

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

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

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

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

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