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

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

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

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

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

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

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

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

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

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

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

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

h.u = c
h.w = c
h.s = e
h.y = m
m.s = b
m.v = e
k.o = b
k.y = b
k.w = m
k.s = g
d.u = h
e.u = k
e.x = i
c.u = h
c.w = h
c.s = e
c.y = m
f.u = h
i.u = c
b.o = k
b.y = k
b.w = m
b.s = i
g.u = c
assert d.u.y.v.u.w.v.txt == "e"