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

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

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

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

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

m.z = g
m.v = e
m.o = b
m.t = k
n.z = c
k.z = c
k.s = g
k.q = f
k.v = b
e.q = b
e.o = m
e.t = a
e.z = f
c.z = k
c.v = a
c.o = b
c.t = g
g.z = c
g.v = c
g.s = k
g.q = d
d.z = c
f.z = b
a.q = b
a.o = c
a.t = e
a.z = n
b.z = g
b.v = a
b.o = m
b.t = k
assert b.z.q.z.v.o.o.v.o.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: D = None
        self.o: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

m.z = g
m.v = e
m.o = b
m.t = k
n.z = c
k.z = c
k.s = g
k.q = f
k.v = b
e.q = b
e.o = m
e.t = a
e.z = f
c.z = k
c.v = a
c.o = b
c.t = g
g.z = c
g.v = c
g.s = k
g.q = d
d.z = c
f.z = b
a.q = b
a.o = c
a.t = e
a.z = n
b.z = g
b.v = a
b.o = m
b.t = k
assert b.z.q.z.v.o.o.v.o.o.z.txt == "g"