class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: A = None
        self.r: C = None
        self.w: A = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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