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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.p: D = None
        self.u: E = None
        self.r: D = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.s: G = None
        self.r: I = None
        self.v: I = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: A = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.p: D = None
        self.u: E = None
        self.r: D = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.s: G = None
        self.r: I = None
        self.v: I = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: A = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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