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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.v: A = None
        self.r: B = None
        self.z: H = None
        self.x: B = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.y: B = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: I = None
        self.w: H = None
        self.v: C = None
        self.y: I = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: H = None
        self.w: H = None
        self.x: B = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.v: A = None
        self.r: B = None
        self.z: H = None
        self.x: B = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.y: B = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: I = None
        self.w: H = None
        self.v: C = None
        self.y: I = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: H = None
        self.w: H = None
        self.x: B = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: F = None
        self.txt = txt

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

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

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