class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.y: B = None
        self.t: G = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.w: I = None
        self.x: F = None
        self.p: B = None
        self.v: F = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: I = None
        self.p: A = None
        self.q: F = None
        self.z: H = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

h = A("h")
a = B("a")
b = C("b")
m = D("m")
n = E("n")
f = F("f")
l = G("l")
j = H("j")
g = I("g")

h.p = g
h.y = a
h.t = l
h.r = b
h.v = b
a.p = b
a.x = l
b.t = h
b.s = m
b.p = m
b.x = f
b.q = f
b.y = f
m.q = h
m.r = h
m.y = h
m.w = g
m.x = f
m.v = f
m.p = a
m.z = j
n.x = l
n.r = g
n.p = h
n.q = f
n.z = j
n.w = m
f.o = g
l.z = g
j.r = h
g.t = m
assert j.r.r.x.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.y: B = None
        self.t: G = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.w: I = None
        self.x: F = None
        self.p: B = None
        self.v: F = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: I = None
        self.p: A = None
        self.q: F = None
        self.z: H = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

h = A("h")
a = B("a")
b = C("b")
m = D("m")
n = E("n")
f = F("f")
l = G("l")
j = H("j")
g = I("g")

h.p = g
h.y = a
h.t = l
h.r = b
h.v = b
a.p = b
a.x = l
b.t = h
b.s = m
b.p = m
b.x = f
b.q = f
b.y = f
m.q = h
m.r = h
m.y = h
m.w = g
m.x = f
m.v = f
m.p = a
m.z = j
n.x = l
n.r = g
n.p = h
n.q = f
n.z = j
n.w = m
f.o = g
l.z = g
j.r = h
g.t = m
assert j.r.r.x.o.t.txt == "m"