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

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

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

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

g = A("g")
h = B("h")
d = C("d")
k = D("k")
m = A("m")
i = A("i")
l = B("l")
a = A("a")
j = A("j")

g.o = h
g.w = l
g.z = l
g.u = d
h.y = d
h.u = l
h.w = a
h.q = j
d.z = j
k.u = h
k.t = d
m.o = l
m.w = h
m.z = h
m.u = d
i.o = h
i.w = h
i.z = h
i.u = d
l.y = d
l.u = h
l.w = a
l.q = m
a.o = h
a.z = h
a.w = l
a.u = d
j.o = h
j.z = h
j.w = l
j.u = d
assert l.q.u.z.u.z.u.z.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

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

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

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

g = A("g")
h = B("h")
d = C("d")
k = D("k")
m = A("m")
i = A("i")
l = B("l")
a = A("a")
j = A("j")

g.o = h
g.w = l
g.z = l
g.u = d
h.y = d
h.u = l
h.w = a
h.q = j
d.z = j
k.u = h
k.t = d
m.o = l
m.w = h
m.z = h
m.u = d
i.o = h
i.w = h
i.z = h
i.u = d
l.y = d
l.u = h
l.w = a
l.q = m
a.o = h
a.z = h
a.w = l
a.u = d
j.o = h
j.z = h
j.w = l
j.u = d
assert l.q.u.z.u.z.u.z.o.q.txt == "j"