class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: C = None
        self.z: I = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: F = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.x: C = None
        self.u: B = None
        self.t: A = None
        self.w: H = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: F = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.x: C = None
        self.u: B = None
        self.t: A = None
        self.w: H = None
        self.txt = txt

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

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

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

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