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

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: H = None
        self.t: G = None
        self.q: F = None
        self.w: F = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: H = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: I = None
        self.o: B = None
        self.t: I = None
        self.p: F = None
        self.q: C = None
        self.v: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: H = None
        self.t: G = None
        self.q: F = None
        self.w: F = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: H = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: I = None
        self.o: B = None
        self.t: I = None
        self.p: F = None
        self.q: C = None
        self.v: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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