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

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

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

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

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

l.s = g
l.u = g
m.o = g
m.t = k
g.v = d
g.z = m
g.t = m
j.o = g
j.p = g
j.y = d
j.v = i
n.o = g
n.t = l
k.s = g
k.u = g
b.s = g
b.u = g
d.o = g
d.p = g
d.y = j
d.v = i
i.o = g
i.p = g
i.y = d
i.v = d
a.s = g
a.u = g
assert i.o.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: C = None
        self.txt = txt

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

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

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

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

l.s = g
l.u = g
m.o = g
m.t = k
g.v = d
g.z = m
g.t = m
j.o = g
j.p = g
j.y = d
j.v = i
n.o = g
n.t = l
k.s = g
k.u = g
b.s = g
b.u = g
d.o = g
d.p = g
d.y = j
d.v = i
i.o = g
i.p = g
i.y = d
i.v = d
a.s = g
a.u = g
assert i.o.z.o.txt == "g"