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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: C = None
        self.u: E = None
        self.p: E = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: A = None
        self.z: G = None
        self.o: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: C = None
        self.x: H = None
        self.r: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: C = None
        self.u: E = None
        self.p: E = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: A = None
        self.z: G = None
        self.o: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: C = None
        self.x: H = None
        self.r: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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