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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: H = None
        self.s: C = None
        self.u: D = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: F = None
        self.r: G = None
        self.o: B = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: A = None
        self.v: D = None
        self.o: C = None
        self.r: B = None
        self.p: A = None
        self.x: G = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: H = None
        self.s: C = None
        self.u: D = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: F = None
        self.r: G = None
        self.o: B = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: A = None
        self.v: D = None
        self.o: C = None
        self.r: B = None
        self.p: A = None
        self.x: G = None
        self.z: C = None
        self.txt = txt

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

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