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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: F = None
        self.x: E = None
        self.y: F = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.q: G = None
        self.r: G = None
        self.z: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: F = None
        self.x: E = None
        self.y: F = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.q: G = None
        self.r: G = None
        self.z: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.txt = txt

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

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