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

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

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

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

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

m.r = a
m.w = k
m.s = k
l.r = k
j.v = c
j.t = n
j.z = n
j.u = g
g.v = f
k.v = l
k.t = n
k.z = n
k.u = g
a.r = j
c.r = i
f.v = g
i.v = l
i.t = m
i.z = m
i.u = f
n.r = c
n.w = i
n.s = i
assert c.r.u.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

m.r = a
m.w = k
m.s = k
l.r = k
j.v = c
j.t = n
j.z = n
j.u = g
g.v = f
k.v = l
k.t = n
k.z = n
k.u = g
a.r = j
c.r = i
f.v = g
i.v = l
i.t = m
i.z = m
i.u = f
n.r = c
n.w = i
n.s = i
assert c.r.u.v.v.txt == "f"