class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: G = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: I = None
        self.s: F = None
        self.x: D = None
        self.q: C = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: A = None
        self.q: G = None
        self.v: G = None
        self.t: A = None
        self.y: H = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: B = None
        self.u: H = None
        self.z: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: H = None
        self.w: H = None
        self.p: E = None
        self.r: G = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: I = None
        self.s: F = None
        self.x: D = None
        self.q: C = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: A = None
        self.q: G = None
        self.v: G = None
        self.t: A = None
        self.y: H = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: B = None
        self.u: H = None
        self.z: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: H = None
        self.w: H = None
        self.p: E = None
        self.r: G = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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