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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.q: C = None
        self.p: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.q: C = None
        self.p: C = None
        self.x: D = None
        self.txt = txt

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

e.w = n
e.q = l
e.u = k
l.s = j
l.u = m
l.w = h
l.o = d
l.z = d
b.w = d
b.p = d
b.x = i
b.q = j
d.q = k
i.r = k
i.s = k
i.q = k
i.p = b
i.x = d
k.w = d
k.p = d
k.x = i
k.q = j
m.w = i
m.q = h
m.u = k
j.w = d
j.p = d
j.x = i
j.q = k
n.r = j
n.p = j
n.s = b
n.q = k
n.x = d
h.s = b
h.u = m
h.w = l
h.o = d
h.z = d
assert e.w.q.x.x.q.q.q.p.q.p.txt == "d"