class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: A = None
        self.y: C = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.t: D = None
        self.s: A = None
        self.w: D = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
k = C("k")
m = D("m")
d = E("d")
g = E("g")
c = A("c")
b = A("b")
l = E("l")
f = C("f")

e.x = g
e.q = b
e.y = k
e.u = m
e.s = m
j.r = m
k.y = c
k.u = f
k.t = m
k.w = m
k.s = b
m.w = g
d.p = g
d.q = m
d.t = j
d.z = j
g.p = d
g.q = m
g.t = j
g.z = j
c.x = g
c.q = e
c.y = f
c.u = m
c.s = m
b.x = g
b.q = c
b.y = k
b.u = m
b.s = m
l.p = d
l.q = m
l.t = j
l.z = j
f.y = b
f.s = b
f.u = k
f.t = m
f.w = m
assert f.u.s.u.w.q.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: A = None
        self.y: C = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.t: D = None
        self.s: A = None
        self.w: D = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
k = C("k")
m = D("m")
d = E("d")
g = E("g")
c = A("c")
b = A("b")
l = E("l")
f = C("f")

e.x = g
e.q = b
e.y = k
e.u = m
e.s = m
j.r = m
k.y = c
k.u = f
k.t = m
k.w = m
k.s = b
m.w = g
d.p = g
d.q = m
d.t = j
d.z = j
g.p = d
g.q = m
g.t = j
g.z = j
c.x = g
c.q = e
c.y = f
c.u = m
c.s = m
b.x = g
b.q = c
b.y = k
b.u = m
b.s = m
l.p = d
l.q = m
l.t = j
l.z = j
f.y = b
f.s = b
f.u = k
f.t = m
f.w = m
assert f.u.s.u.w.q.w.p.txt == "d"