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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.x: D = None
        self.z: C = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
a = C("a")
h = D("h")
k = A("k")
b = A("b")
d = C("d")
e = C("e")
n = C("n")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.x: D = None
        self.z: C = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
a = C("a")
h = D("h")
k = A("k")
b = A("b")
d = C("d")
e = C("e")
n = C("n")

j.p = m
j.z = k
j.w = a
j.r = h
m.o = h
m.y = h
m.x = h
m.z = d
a.q = h
a.s = h
a.o = h
a.u = b
h.v = d
h.u = j
h.p = k
k.p = m
k.z = j
k.w = d
k.r = h
b.p = m
b.z = j
b.w = e
b.r = h
d.q = h
d.s = h
d.o = h
d.u = j
e.q = h
e.s = h
e.o = h
e.u = j
n.q = h
n.s = h
n.o = h
n.u = j
assert b.w.u.p.z.u.w.u.txt == "b"