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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: G = None
        self.w: B = None
        self.o: G = None
        self.x: H = None
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: I = None
        self.t: C = None
        self.x: B = None
        self.v: A = None
        self.z: D = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: I = None
        self.v: G = None
        self.w: B = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: G = None
        self.w: B = None
        self.o: G = None
        self.x: H = None
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: I = None
        self.t: C = None
        self.x: B = None
        self.v: A = None
        self.z: D = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: I = None
        self.v: G = None
        self.w: B = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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