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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: B = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

j = A("j")
b = B("b")
k = C("k")
a = D("a")
d = E("d")
m = D("m")
e = E("e")
h = E("h")
g = B("g")

j.p = a
j.x = a
j.u = g
j.z = h
b.w = k
b.s = k
b.q = k
b.u = a
k.p = m
a.p = g
d.o = b
d.y = b
d.r = g
d.u = h
m.p = b
e.o = g
e.r = g
e.y = g
e.u = h
h.o = g
h.r = g
h.u = d
h.y = b
g.w = k
g.s = k
g.q = k
g.u = a
assert h.u.u.o.s.p.p.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: B = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

j = A("j")
b = B("b")
k = C("k")
a = D("a")
d = E("d")
m = D("m")
e = E("e")
h = E("h")
g = B("g")

j.p = a
j.x = a
j.u = g
j.z = h
b.w = k
b.s = k
b.q = k
b.u = a
k.p = m
a.p = g
d.o = b
d.y = b
d.r = g
d.u = h
m.p = b
e.o = g
e.r = g
e.y = g
e.u = h
h.o = g
h.r = g
h.u = d
h.y = b
g.w = k
g.s = k
g.q = k
g.u = a
assert h.u.u.o.s.p.p.w.p.txt == "m"