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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: G = None
        self.x: G = None
        self.r: F = None
        self.o: B = None
        self.s: B = None
        self.z: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: G = None
        self.x: G = None
        self.r: F = None
        self.o: B = None
        self.s: B = None
        self.z: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

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