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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.r: G = None
        self.z: G = None
        self.v: A = None
        self.o: A = None
        self.x: H = None
        self.u: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: I = None
        self.q: B = None
        self.x: I = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: E = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.r: G = None
        self.z: G = None
        self.v: A = None
        self.o: A = None
        self.x: H = None
        self.u: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: I = None
        self.q: B = None
        self.x: I = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: E = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

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

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