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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

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

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

l.r = k
l.u = m
l.y = g
a.s = b
a.y = d
a.x = g
a.q = k
k.o = n
k.y = n
k.v = g
k.w = m
m.s = g
d.s = k
b.s = i
b.y = d
b.x = k
b.q = k
n.r = g
n.u = m
n.y = k
i.s = b
i.y = d
i.x = g
i.q = k
g.o = n
g.y = n
g.v = k
g.w = d
c.s = i
c.y = m
c.x = g
c.q = k
assert m.s.w.s.w.s.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

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

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

l.r = k
l.u = m
l.y = g
a.s = b
a.y = d
a.x = g
a.q = k
k.o = n
k.y = n
k.v = g
k.w = m
m.s = g
d.s = k
b.s = i
b.y = d
b.x = k
b.q = k
n.r = g
n.u = m
n.y = k
i.s = b
i.y = d
i.x = g
i.q = k
g.o = n
g.y = n
g.v = k
g.w = d
c.s = i
c.y = m
c.x = g
c.q = k
assert m.s.w.s.w.s.v.v.txt == "g"