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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.q: B = None
        self.t: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.q: B = None
        self.t: B = None
        self.txt = txt

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

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

j.q = n
j.r = c
j.w = h
c.y = b
c.t = k
c.z = k
m.z = e
m.v = d
m.u = d
m.p = b
m.x = j
h.p = n
h.z = e
h.q = c
h.t = c
n.y = h
n.p = d
n.z = c
n.x = b
e.z = k
e.v = h
e.u = h
e.p = b
e.x = b
k.z = e
k.v = h
k.u = h
k.p = b
k.x = j
b.q = n
b.r = c
b.w = h
d.p = n
d.z = e
d.q = c
d.t = c
a.q = n
a.r = c
a.w = d
assert a.w.z.z.p.r.y.r.txt == "c"