class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.w: G = None
        self.r: H = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: G = None
        self.q: D = None
        self.v: F = None
        self.o: H = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: H = None
        self.r: B = None
        self.s: E = None
        self.q: I = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: D = None
        self.y: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.z: C = None
        self.w: C = None
        self.o: A = None
        self.q: E = None
        self.v: F = None
        self.s: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: G = None
        self.q: D = None
        self.v: F = None
        self.o: H = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: H = None
        self.r: B = None
        self.s: E = None
        self.q: I = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: D = None
        self.y: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.z: C = None
        self.w: C = None
        self.o: A = None
        self.q: E = None
        self.v: F = None
        self.s: H = None
        self.txt = txt

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

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