class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: H = None
        self.t: G = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: B = None
        self.o: G = None
        self.u: E = None
        self.y: G = None
        self.s: E = None
        self.p: G = None
        self.x: D = None
        self.txt = txt

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

m = A("m")
c = B("c")
b = C("b")
i = D("i")
h = E("h")
j = F("j")
e = G("e")
f = H("f")
n = I("n")

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: H = None
        self.t: G = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: B = None
        self.o: G = None
        self.u: E = None
        self.y: G = None
        self.s: E = None
        self.p: G = None
        self.x: D = None
        self.txt = txt

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

m = A("m")
c = B("c")
b = C("b")
i = D("i")
h = E("h")
j = F("j")
e = G("e")
f = H("f")
n = I("n")

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