class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: H = None
        self.p: H = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: C = None
        self.u: H = None
        self.t: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: A = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.x: H = None
        self.p: C = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: F = None
        self.q: D = None
        self.z: E = None
        self.x: D = None
        self.o: A = None
        self.p: A = None
        self.txt = txt

f = A("f")
j = B("j")
d = C("d")
g = D("g")
m = E("m")
k = F("k")
n = G("n")
h = H("h")
e = C("e")
c = C("c")

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: C = None
        self.u: H = None
        self.t: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: A = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.x: H = None
        self.p: C = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: F = None
        self.q: D = None
        self.z: E = None
        self.x: D = None
        self.o: A = None
        self.p: A = None
        self.txt = txt

f = A("f")
j = B("j")
d = C("d")
g = D("g")
m = E("m")
k = F("k")
n = G("n")
h = H("h")
e = C("e")
c = C("c")

f.r = m
f.z = h
f.p = h
f.o = g
j.x = g
d.s = k
d.w = e
d.u = h
d.t = f
d.q = j
g.y = n
g.q = f
g.v = k
m.z = k
m.s = c
m.x = g
m.p = g
m.r = g
m.u = j
k.r = d
k.x = m
k.v = g
n.q = e
n.v = k
n.x = h
n.p = c
n.s = f
n.o = m
h.y = g
h.q = g
h.x = g
h.t = k
h.z = m
h.o = f
h.p = f
e.s = k
e.w = c
e.u = h
e.t = f
e.q = j
c.s = k
c.w = e
c.u = h
c.t = f
c.q = j
assert d.u.z.s.w.t.p.z.r.y.s.txt == "f"