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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.w: D = None
        self.p: A = None
        self.txt = txt

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

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

d = A("d")
c = B("c")
l = C("l")
e = D("e")
i = C("i")
a = B("a")
g = A("g")
h = C("h")
f = A("f")
m = D("m")

d.y = i
d.u = g
d.s = a
c.o = f
c.u = i
c.w = m
c.p = d
l.z = m
l.u = m
l.t = d
l.v = g
e.o = i
e.v = h
i.z = e
i.u = e
i.t = g
i.v = f
a.o = g
a.u = l
a.w = m
a.p = f
g.y = i
g.u = f
g.s = a
h.z = m
h.u = e
h.t = f
h.v = f
f.y = i
f.u = d
f.s = c
m.o = i
m.v = l
assert d.s.w.v.v.u.s.o.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: A = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.w: D = None
        self.p: A = None
        self.txt = txt

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

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

d = A("d")
c = B("c")
l = C("l")
e = D("e")
i = C("i")
a = B("a")
g = A("g")
h = C("h")
f = A("f")
m = D("m")

d.y = i
d.u = g
d.s = a
c.o = f
c.u = i
c.w = m
c.p = d
l.z = m
l.u = m
l.t = d
l.v = g
e.o = i
e.v = h
i.z = e
i.u = e
i.t = g
i.v = f
a.o = g
a.u = l
a.w = m
a.p = f
g.y = i
g.u = f
g.s = a
h.z = m
h.u = e
h.t = f
h.v = f
f.y = i
f.u = d
f.s = c
m.o = i
m.v = l
assert d.s.w.v.v.u.s.o.s.u.txt == "i"