class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: D = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.u: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: D = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.u: H = None
        self.txt = txt

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

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