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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

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