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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: H = None
        self.p: H = None
        self.w: H = None
        self.u: G = None
        self.z: B = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: I = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.q: D = None
        self.v: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: H = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: H = None
        self.p: H = None
        self.w: H = None
        self.u: G = None
        self.z: B = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: I = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.q: D = None
        self.v: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: H = None
        self.x: D = None
        self.txt = txt

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

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