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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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