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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: G = None
        self.v: C = None
        self.p: A = None
        self.s: F = None
        self.o: G = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: G = None
        self.v: C = None
        self.p: A = None
        self.s: F = None
        self.o: G = None
        self.z: D = None
        self.txt = txt

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

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

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