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

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

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

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

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

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

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

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

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

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

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