class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: E = None
        self.t: C = None
        self.w: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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