class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.y: I = None
        self.z: F = None
        self.w: C = None
        self.s: E = None
        self.r: I = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.v: A = None
        self.u: I = None
        self.z: G = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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

f = A("f")
h = B("h")
g = C("g")
b = D("b")
k = E("k")
l = F("l")
i = G("i")
n = H("n")
e = I("e")

f.q = g
f.w = g
f.p = g
f.v = k
f.s = k
f.y = e
f.r = e
f.z = l
h.w = l
h.t = l
h.r = l
h.p = e
g.v = n
b.w = n
b.s = n
k.y = f
k.v = f
k.w = g
k.u = e
k.x = e
k.z = i
l.r = e
l.q = h
l.w = b
l.t = g
l.v = f
l.s = n
i.v = g
i.z = h
i.o = k
n.x = g
n.p = e
n.o = e
n.z = b
e.x = b
e.p = b
e.q = i
e.w = l
e.t = l
e.s = f
e.y = k
e.v = n
e.z = g
assert l.s.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.y: I = None
        self.z: F = None
        self.w: C = None
        self.s: E = None
        self.r: I = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.v: A = None
        self.u: I = None
        self.z: G = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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

f = A("f")
h = B("h")
g = C("g")
b = D("b")
k = E("k")
l = F("l")
i = G("i")
n = H("n")
e = I("e")

f.q = g
f.w = g
f.p = g
f.v = k
f.s = k
f.y = e
f.r = e
f.z = l
h.w = l
h.t = l
h.r = l
h.p = e
g.v = n
b.w = n
b.s = n
k.y = f
k.v = f
k.w = g
k.u = e
k.x = e
k.z = i
l.r = e
l.q = h
l.w = b
l.t = g
l.v = f
l.s = n
i.v = g
i.z = h
i.o = k
n.x = g
n.p = e
n.o = e
n.z = b
e.x = b
e.p = b
e.q = i
e.w = l
e.t = l
e.s = f
e.y = k
e.v = n
e.z = g
assert l.s.o.z.txt == "g"