class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: H = None
        self.x: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: H = None
        self.x: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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