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

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

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

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

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

m = A("m")
a = B("a")
j = C("j")
h = D("h")
l = E("l")
b = E("b")
f = D("f")
k = A("k")

m.y = k
m.w = k
a.p = l
a.u = f
j.x = k
j.w = b
j.s = b
j.u = a
j.p = l
h.y = a
h.z = a
h.o = a
h.u = f
l.x = j
l.w = h
l.u = a
b.x = j
b.w = h
b.u = a
f.y = a
f.z = a
f.o = a
f.u = h
k.y = m
k.w = m
assert b.w.z.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

m = A("m")
a = B("a")
j = C("j")
h = D("h")
l = E("l")
b = E("b")
f = D("f")
k = A("k")

m.y = k
m.w = k
a.p = l
a.u = f
j.x = k
j.w = b
j.s = b
j.u = a
j.p = l
h.y = a
h.z = a
h.o = a
h.u = f
l.x = j
l.w = h
l.u = a
b.x = j
b.w = h
b.u = a
f.y = a
f.z = a
f.o = a
f.u = h
k.y = m
k.w = m
assert b.w.z.p.u.p.txt == "l"