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

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

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

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

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

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

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

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

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

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

j.t = g
j.v = d
l.o = k
l.t = g
g.t = i
g.s = j
m.w = g
m.v = a
i.w = g
i.v = l
e.t = g
e.v = m
d.w = g
d.v = k
k.o = a
k.t = g
a.o = k
a.t = g
n.w = g
n.v = l
assert e.t.s.t.t.txt == "i"