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

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

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

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

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

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

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

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

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

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

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

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

c.y = b
c.p = a
i.p = h
i.y = a
i.w = m
i.u = b
g.v = m
g.r = a
g.o = e
g.y = f
g.s = c
f.s = c
f.r = a
m.q = e
m.y = f
a.p = h
a.y = i
a.w = m
a.u = b
h.y = b
h.p = a
b.s = h
b.r = a
e.v = m
e.r = i
e.o = g
e.y = f
e.s = c
assert m.y.r.y.u.s.txt == "h"