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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: G = None
        self.r: H = None
        self.v: H = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.r: E = None
        self.t: A = None
        self.o: D = None
        self.p: H = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: A = None
        self.z: I = None
        self.v: G = None
        self.s: E = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: C = None
        self.x: B = None
        self.r: C = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: G = None
        self.r: H = None
        self.v: H = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.r: E = None
        self.t: A = None
        self.o: D = None
        self.p: H = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: A = None
        self.z: I = None
        self.v: G = None
        self.s: E = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: C = None
        self.x: B = None
        self.r: C = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

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

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