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

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

i = A("i")
f = B("f")
h = C("h")
b = D("b")
a = E("a")
k = B("k")
c = D("c")
d = E("d")
m = B("m")

i.y = m
i.z = m
i.v = f
f.y = k
f.r = c
h.q = d
h.s = i
h.w = i
b.q = c
b.p = c
b.u = i
a.y = h
a.w = b
a.u = f
k.y = f
k.r = b
c.q = b
c.p = b
c.u = i
d.y = h
d.w = b
d.u = k
m.y = f
m.r = b
assert b.q.p.u.v.r.u.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: B = None
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

i = A("i")
f = B("f")
h = C("h")
b = D("b")
a = E("a")
k = B("k")
c = D("c")
d = E("d")
m = B("m")

i.y = m
i.z = m
i.v = f
f.y = k
f.r = c
h.q = d
h.s = i
h.w = i
b.q = c
b.p = c
b.u = i
a.y = h
a.w = b
a.u = f
k.y = f
k.r = b
c.q = b
c.p = b
c.u = i
d.y = h
d.w = b
d.u = k
m.y = f
m.r = b
assert b.q.p.u.v.r.u.z.r.txt == "b"