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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: F = None
        self.s: F = None
        self.v: H = None
        self.q: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: G = None
        self.v: A = None
        self.t: G = None
        self.x: I = None
        self.q: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: F = None
        self.s: F = None
        self.v: H = None
        self.q: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: G = None
        self.v: A = None
        self.t: G = None
        self.x: I = None
        self.q: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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