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

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

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

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

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

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

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

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

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

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

d.s = m
d.v = l
j.p = m
j.o = a
j.v = i
a.r = e
a.t = d
a.z = g
a.q = k
m.w = i
m.p = k
m.v = j
g.s = m
g.v = b
e.r = a
e.t = l
e.z = d
e.q = k
b.s = m
b.v = d
k.p = m
k.v = m
k.o = a
l.s = i
l.v = g
i.w = m
i.p = k
i.v = j
assert g.v.v.v.txt == "l"