class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.u: E = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

i.o = a
i.u = a
i.r = a
i.y = d
i.q = d
d.s = e
f.z = d
e.y = d
e.x = b
a.v = l
a.s = e
h.o = a
h.u = a
h.r = a
h.y = d
h.q = d
l.z = d
g.z = d
b.o = a
b.u = a
b.r = a
b.y = d
b.q = d
assert b.o.v.z.s.y.s.y.s.txt == "e"