class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.y: B = None
        self.u: C = None
        self.s: G = None
        self.z: H = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.r: F = None
        self.u: I = None
        self.v: C = None
        self.s: D = None
        self.t: C = None
        self.y: B = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.o: E = None
        self.r: C = None
        self.u: E = None
        self.p: D = None
        self.z: F = None
        self.s: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: B = None
        self.o: G = None
        self.r: F = None
        self.y: A = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.r: F = None
        self.u: I = None
        self.v: C = None
        self.s: D = None
        self.t: C = None
        self.y: B = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.o: E = None
        self.r: C = None
        self.u: E = None
        self.p: D = None
        self.z: F = None
        self.s: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: B = None
        self.o: G = None
        self.r: F = None
        self.y: A = None
        self.x: E = None
        self.txt = txt

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

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