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

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

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

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

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

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

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

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

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

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

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