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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: B = None
        self.u: E = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: D = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

h = A("h")
i = B("i")
n = C("n")
j = D("j")
e = E("e")
k = D("k")
m = A("m")
g = C("g")
f = B("f")
a = C("a")

h.x = e
h.y = e
i.x = n
n.t = m
n.r = f
n.u = e
n.w = h
j.x = g
j.r = k
j.v = e
j.p = m
e.o = h
e.w = i
e.v = g
e.r = k
k.x = n
k.r = j
k.v = e
k.p = h
m.x = e
m.y = e
g.t = h
g.r = f
g.u = e
g.w = m
f.x = n
a.t = m
a.w = m
a.r = f
a.u = e
assert h.x.o.y.v.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: B = None
        self.u: E = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: D = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

h = A("h")
i = B("i")
n = C("n")
j = D("j")
e = E("e")
k = D("k")
m = A("m")
g = C("g")
f = B("f")
a = C("a")

h.x = e
h.y = e
i.x = n
n.t = m
n.r = f
n.u = e
n.w = h
j.x = g
j.r = k
j.v = e
j.p = m
e.o = h
e.w = i
e.v = g
e.r = k
k.x = n
k.r = j
k.v = e
k.p = h
m.x = e
m.y = e
g.t = h
g.r = f
g.u = e
g.w = m
f.x = n
a.t = m
a.w = m
a.r = f
a.u = e
assert h.x.o.y.v.w.y.txt == "e"