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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: C = None
        self.v: I = None
        self.p: I = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: C = None
        self.v: I = None
        self.p: I = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.s: B = None
        self.txt = txt

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

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