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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.x: E = None
        self.q: I = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: A = None
        self.x: F = None
        self.z: C = None
        self.q: E = None
        self.t: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

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

g.t = n
g.v = c
b.o = k
i.t = n
i.w = d
n.x = d
n.y = l
n.t = i
l.z = g
k.p = d
k.v = c
k.x = l
k.q = e
k.w = g
d.s = k
d.x = k
d.y = g
d.z = i
d.q = l
d.t = c
c.o = d
c.v = g
c.s = i
e.s = i
e.v = i
e.r = i
e.y = g
assert g.t.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.x: E = None
        self.q: I = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: A = None
        self.x: F = None
        self.z: C = None
        self.q: E = None
        self.t: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

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

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