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

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

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

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

a = A("a")
j = B("j")
e = C("e")
i = D("i")
f = A("f")
g = C("g")
l = C("l")
b = D("b")
c = D("c")
k = D("k")

a.q = g
a.u = c
a.p = c
a.z = b
j.v = i
e.y = a
e.w = a
e.v = b
e.t = f
i.x = l
i.v = a
i.p = j
i.o = g
f.q = g
f.u = i
f.p = i
f.z = c
g.y = f
g.w = a
g.t = a
g.v = k
l.y = a
l.w = f
l.t = f
l.v = c
b.x = e
b.o = e
b.v = a
b.p = j
c.x = l
c.o = l
c.v = f
c.p = j
k.x = e
k.o = e
k.v = f
k.p = j
assert l.v.o.t.q.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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

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

a = A("a")
j = B("j")
e = C("e")
i = D("i")
f = A("f")
g = C("g")
l = C("l")
b = D("b")
c = D("c")
k = D("k")

a.q = g
a.u = c
a.p = c
a.z = b
j.v = i
e.y = a
e.w = a
e.v = b
e.t = f
i.x = l
i.v = a
i.p = j
i.o = g
f.q = g
f.u = i
f.p = i
f.z = c
g.y = f
g.w = a
g.t = a
g.v = k
l.y = a
l.w = f
l.t = f
l.v = c
b.x = e
b.o = e
b.v = a
b.p = j
c.x = l
c.o = l
c.v = f
c.p = j
k.x = e
k.o = e
k.v = f
k.p = j
assert l.v.o.t.q.v.p.v.txt == "i"