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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.x: C = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.z: A = None
        self.q: D = None
        self.x: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.x: C = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.z: A = None
        self.q: D = None
        self.x: D = None
        self.txt = txt

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

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

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