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

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

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

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

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

e.q = k
e.s = b
e.v = i
e.o = m
m.z = b
d.s = e
d.q = f
d.z = f
d.u = j
k.v = g
k.p = m
k.y = e
j.s = i
j.q = e
j.z = e
j.u = d
l.v = g
l.p = m
l.y = f
f.q = b
f.s = b
f.v = i
f.o = m
b.v = g
b.p = m
b.y = e
g.v = l
g.p = m
g.y = e
i.q = b
i.s = k
i.v = e
i.o = m
assert d.z.v.v.o.z.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.v: A = None
        self.o: B = None
        self.txt = txt

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

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

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

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

e.q = k
e.s = b
e.v = i
e.o = m
m.z = b
d.s = e
d.q = f
d.z = f
d.u = j
k.v = g
k.p = m
k.y = e
j.s = i
j.q = e
j.z = e
j.u = d
l.v = g
l.p = m
l.y = f
f.q = b
f.s = b
f.v = i
f.o = m
b.v = g
b.p = m
b.y = e
g.v = l
g.p = m
g.y = e
i.q = b
i.s = k
i.v = e
i.o = m
assert d.z.v.v.o.z.y.v.txt == "i"