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

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

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

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

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

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

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

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

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

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

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