class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: C = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

b = A("b")
c = B("c")
i = C("i")
h = D("h")
e = E("e")
f = D("f")
m = D("m")
d = A("d")
j = C("j")
l = C("l")

b.y = d
b.v = e
b.q = e
c.s = e
c.p = l
i.x = e
i.s = l
i.t = c
h.y = e
e.q = b
e.w = h
e.y = c
e.s = c
f.y = e
m.y = e
d.y = b
d.v = e
d.q = e
j.x = e
j.s = i
j.t = c
l.x = e
l.s = j
l.t = c
assert d.q.w.y.w.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: C = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

b = A("b")
c = B("c")
i = C("i")
h = D("h")
e = E("e")
f = D("f")
m = D("m")
d = A("d")
j = C("j")
l = C("l")

b.y = d
b.v = e
b.q = e
c.s = e
c.p = l
i.x = e
i.s = l
i.t = c
h.y = e
e.q = b
e.w = h
e.y = c
e.s = c
f.y = e
m.y = e
d.y = b
d.v = e
d.q = e
j.x = e
j.s = i
j.t = c
l.x = e
l.s = j
l.t = c
assert d.q.w.y.w.y.w.txt == "h"