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

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

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

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

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

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

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

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

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

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

m.r = d
m.t = i
m.v = b
n.o = b
b.s = l
b.q = j
b.w = e
e.w = n
e.r = d
l.r = d
l.t = i
l.v = b
d.w = f
d.r = j
f.o = b
i.r = j
i.t = l
i.v = b
j.w = f
j.r = e
a.o = b
assert f.o.q.w.o.w.w.o.s.txt == "l"