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

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

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

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

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

d = A("d")
m = B("m")
a = C("a")
n = D("n")
i = E("i")
h = A("h")
l = E("l")
g = C("g")
k = D("k")
b = C("b")

d.u = g
d.y = m
d.o = k
d.v = a
d.r = a
m.u = g
a.w = m
a.v = m
a.o = m
a.x = g
n.u = k
n.x = g
i.u = h
i.s = b
i.t = d
h.u = b
h.y = m
h.o = k
h.v = g
h.r = g
l.u = d
l.s = b
l.t = h
g.w = m
g.v = m
g.o = m
g.x = a
k.u = n
k.x = b
b.w = m
b.v = m
b.o = m
b.x = a
assert g.v.u.x.x.x.v.u.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: B = None
        self.o: D = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

d = A("d")
m = B("m")
a = C("a")
n = D("n")
i = E("i")
h = A("h")
l = E("l")
g = C("g")
k = D("k")
b = C("b")

d.u = g
d.y = m
d.o = k
d.v = a
d.r = a
m.u = g
a.w = m
a.v = m
a.o = m
a.x = g
n.u = k
n.x = g
i.u = h
i.s = b
i.t = d
h.u = b
h.y = m
h.o = k
h.v = g
h.r = g
l.u = d
l.s = b
l.t = h
g.w = m
g.v = m
g.o = m
g.x = a
k.u = n
k.x = b
b.w = m
b.v = m
b.o = m
b.x = a
assert g.v.u.x.x.x.v.u.x.v.txt == "m"